Create Report Print Service for multiple layers

127
1
Jump to solution
11-21-2022 02:00 PM
MaddieMooreDEQ
New Contributor II

Hello all,

I am in the process of building a print service for printing multiple different reports for different layers. This print widget is from a custom print service created in arcpro from the Export Web Map and Get Layout Templates Info Geoprocessing Services.

I mainly followed the example here: https://www.esri.com/arcgis-blog/products/arcgis-enterprise/mapping/print-reports-from-arcgis-enterp...

I have tweaked the example script to pull multiple reports from the layout folder location and reference the data layer for each particular report

MaddieMooreDEQ_0-1669067699337.png

The widget prints a majority of the reports based on the corresponding layer. However, one layer, randomly chosen by the widget, does not get it's report pulled and is instead placed in a duplicate report template of the one printed right before it.

 

See here:

MaddieMooreDEQ_1-1669067699116.png

 

If anyone has attempted this style of report before and/or has any tips or tricks on how to custom print, any help would be much appreciated!! 

 

Thanks!!

 

Update:

 

After further review it seems to be an issue occurring when the Report is exported to PDF. 

Here is where the report is exported to PDF and should be from the correct reportfn

MaddieMooreDEQ_0-1669213774919.png

Occasionally the output data is put into the report file from the report directly before it in the script

The Print JSON shows that the data from the layer is being pulled appropriately into the report but the wrong report is being pulled to fill from the export web map tool. 

0 Kudos
1 Solution

Accepted Solutions
MaddieMooreDEQ
New Contributor II

After further research here is the solution to this issue: 

It's possible the report list order changes when pulled into the temporary scratch project, so in order to ensure the correct report is grabbed include the Report name in r = p.listReports()[0]. So it would look like this: listReports("*REPORT NAME*")[0]

    listReports("*Report Name*")[0]

View solution in original post

0 Kudos
1 Reply
MaddieMooreDEQ
New Contributor II

After further research here is the solution to this issue: 

It's possible the report list order changes when pulled into the temporary scratch project, so in order to ensure the correct report is grabbed include the Report name in r = p.listReports()[0]. So it would look like this: listReports("*REPORT NAME*")[0]

    listReports("*Report Name*")[0]
0 Kudos