AnsweredAssumed Answered

Export to PDF Report using Python shows OSError: Report: Unable to write PDF to location in ArcGIS Pro 2.6.1

Question asked by manishpatelesriaustralia-com-au-esridist Employee on Sep 25, 2020
Latest reply on Oct 12, 2020 by manishpatelesriaustralia-com-au-esridist

Hello Experts,

 

I have been trying to use the python script as below to export a report to PDF document. The code seems to be working fine for ArcGIS Pro 2.3 however the same code shows error unable to write to location with ArcGIS Pro 2.6.1

 

Steps to reproduce:

1. Create a report in ArcGIS Pro 2.6.1

2. In the Python console, try the below code:

arpx = arcpy.mp.ArcGISProject(r"C:\Users\Administrator\Documents\ArcGIS\Projects\PrintTemplate\PrintTemplate.aprx")

report = arpx.listReports()[0]

report.exportToPDF(r"c:\test.pdf")

Error as shown in the below screenshot:

Error

 

I have tried with different systems, and even tried granting full access but no success.

 

Appreciate if anyone has faced this issue and can provide some workaround.

 

Cheers,
Manish

Outcomes