Hello all,
I am in the process of building a custom Widget for Printing multiple reports on 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 that particular report
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:
Curious if anyone has printed multiple reports using a single print service widget and can advise on how to resolve this duplicating report problem.
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
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.
Solved! Go to Solution.
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]
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]