In the February 2024 update of ArcGIS Online, the Experience Builder Print widget added the capability to utilize output data sources for generating dynamic report. This newly added feature requires a custom enterprise 11.3 print service with a reporting template. This blog will provide you a step-by-step guide on creating and publishing a print service that can be used in Experience Builder to generate reports, and finally we will use this service to recreate Screening widget workflow in Experience Builder.
Here is a sample report for you to explore, To create a report like this, please follow the steps below:
Generate a report template in ArcGIS Pro
In this step you are going to create a report template in ArcGIS Pro that will include all of your layers information in a report format.
Create reports:
- Create a new Pro project with Map template
- Add data to your map (I added the same hosted feature service that I used in my Experience Builder App).
- From the content pane, create a new report by right clicking on a layer and then select New Report from the menu.
- Choose a report template. For this sample print service, I chose Attribute List. Click Next. There is another option Use a custom template. If you already have a custom template created, you can use that as well.
- Enter a Report name and select Data source (I chose Artificial Reef Site in this sample). Click Next.
- Select all rows from Rows dropdown and select fields you want to include in your report. Click Next.
- (Optional) Pick a field for Sorting and/or Summary statistics, otherwise accept default options. In my sample report, I did not add any summary statistics.
- (Optional) Change the Display and Page Setup options and click Finish.
- Now expand both Report header and Page header section from the Contents pane and drag the Report header title text to Page header section. This way the report name appears on top of each page and will not occupy a whole page.
- Create another new report the same way you created the first report. For this, you will need (1) to go to the Map tab (2) then select the layer from the Contents pane and right click on New Report and (3) follow the steps from 4 to 9 to complete the setup.
For my sample service, I have added 10 additional subreports (Fish spawning site, Bird nest sites, High quality water sites, Sensitive species areas, Critical areas, Conservation areas, Marine protected areas, Salt marsh areas, Submerged aquatic vegetation and Fish spawning areas).
Create a master report
In this step, you will incorporate the reports you created in the previous step as subreports to compose a master report.
- Click on the Subreport button from the Insert menu. Add all the reports you have created in the previous steps this way.
- Make sure the Report header section of each subreport is unchecked except the first report.
- Next, rename the main report, I named it Environmental analysis report.
- Next, remove the data references from each subreport. Easiest way to do this is to remove map from the project, when you remove the map you should see a exclamation symbol in front of the report names. This is an important step since if the print service do not have any results to print, it may look for data in the reference data source and returns incorrect results.
Design a cover page for master report
In this step you are going to design a cover page for the master report. You can add your company logo, images and text contents to provide context for your users.
- Select the first report from the view window (Artificial Reef Site Report in this sample) you created.
- Click on the Report Header from the Contents pane to select it.
- Next click on the Report Header tab from the top ribbon and increase the height of this section.
- Next click on the Insert tab from the ribbon and insert images (in jpg format), text and style them to create a cover page.
Create report file
- Using File explorer, create a new folder where your rptx file and map templates will reside.
- From Share tab in ArcGIS Pro, save it as Report File (rptx file) in that newly created folder.
- Copy default map layout templates from C:\Program Files\ArcGIS\Pro\Resources\ArcToolBox\Templates\ExportWebMapTemplates to the folder where your rptx file resides. So all map and report templates are in same place. This is a key step, otherwise your printed report will not have any map.
- From Analysis tab, click on Tools button to open the Geoprocessing pane.
- Search Export Web Map tool, accept the default values for all parameters except Template folder, point it to the new folder where your rptx file and all map templates reside, then run the tool.
- Similarly run the Get Layout Templates Info and Get Report Templates Info tool pointing template folder to your templates folder.
Publish the service
Make sure you are logged in to a Enterprise 11.3 portal with Administrator privilege to publish this custom print service.
- Next, go to the History tab from geoprocessing pane and right click on the Export Web Map tool and click on Share as then Share Web tool.
- Optionally change the name of the tool.
- Make sure that Share with Everyone option is checked.
- Click on the Configuration tab, If you have only few layers, it is recommended to use the Synchronous mode. However, if you have many layers, it is recommended to use the Asynchronous mode to avoid timeout issue. In my case, since I have 11 layers, I used the Asynchronous mode.
- Click on the Content tab, then click on Add Tool and add Get Report Template Info and Get Layout Templates Info one by one.
- Then Analyze and Publish the service.
Now your custom print service is ready to be used in Experience Builder. Please visit this blog to learn how to configure this service in Experience Builder to generate dynamic reports.
Related resources:
- Sample report.
- Create report in ArcGIS Pro: https://pro.arcgis.com/en/pro-app/latest/help/reports/reports-in-arcgis-pro.htm
- Share custom layouts for printing from ArcGIS Pro: https://enterprise.arcgis.com/en/server/latest/publish-services/windows/tutorial-publish-additional-layouts-for-printing-with-arcgis-pro.htm
- Recreating environmental impact analysis workflow of Web Appbuilder Screening widget in Experience Builder
Article Discussion: