ArcGIS Blog

Government

ArcGIS Enterprise

Creating a custom print service with reporting capability

By Aziza Parveen

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:

  1. Create a new Pro project with Map template
  2. Add data to your map (I added the same hosted feature service that I used in my Experience Builder App).
  3. From the content pane, create a new report by right clicking on a layer and then select New Report from the menu.
  4. 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.
  5. Enter a Report name and select Data source (I chose Artificial Reef Site in this sample). Click Next.
  6. Select all rows from Rows dropdown and select fields you want to include in your report. Click Next.
  7. (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.
  8. (Optional) Change the Display and Page Setup options and click Finish.
  9. 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.
  10. 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 new report in pro

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.

  1. Click on the Subreport button from the Insert menu.  Add all the reports you have created in the previous steps this way.
  2. Make sure the Report header section of each subreport is unchecked except the first report.
  3. Next, rename the main report, I named it Environmental analysis report.
  4. 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.
Master report with sub reports

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.

  1. Select the first report from the view window (Artificial Reef Site Report in this sample) you created.
  2. Click on the Report Header from the Contents pane to select it.
  3. Next click on the Report Header tab from the top ribbon and increase the height of this section.
  4. Next click on the Insert tab from the ribbon and insert images (in jpg format), text and style them to create a cover page.
Cover page

Create report file

  1. Using File explorer, create a new folder where your rptx file and map templates will reside.
  2. From Share tab in ArcGIS Pro, save it as Report File (rptx file) in that newly created folder.
  3. 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.
  4. From Analysis tab, click on Tools button to open the Geoprocessing pane.
  5. 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.
  6. 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.

  1. 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.
  2. Optionally change the name of the tool.
  3. Make sure that Share with Everyone option is checked.
  4. 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.
  5. Click on the Content tab, then click on Add Tool and add Get Report Template Info and Get Layout Templates Info one by one.
  6. 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.

Share web tool

Related resources:

Share this article

Subscribe
Notify of
6 Comments
Oldest
Newest
Inline Feedbacks
View all comments