Select to view content in your preferred language

Print Custom Report

1178
1
Jump to solution
11-21-2022 11:16 AM
Labels (2)
MaddieMooreDEQ
Occasional Contributor

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

MaddieMooreDEQ_0-1669056354693.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-1669057351429.png

 

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

MaddieMooreDEQ_0-1669213930543.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. 

 

1 Solution

Accepted Solutions
MaddieMooreDEQ
Occasional Contributor

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
Occasional Contributor

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