As a test I have:
- Authored a test.mxd with one layer called Localities in a single data frame called Layers
- Authored a test.rlf using View | Reports > Create Report of ArcGIS 10.2.2 for Desktop
- Created a Python AddIn which creates the expected PDF file from the Report (*.rlf).
This is the code which all works to create the PDF report from the Localities features within the current extent:
import arcpy import pythonaddins class ReportForExtent(object): def __init__(self): self.enabled = True self.checked = False def onClick(self): mxd = arcpy.mapping.MapDocument("CURRENT") df = arcpy.mapping.ListDataFrames(mxd,"Layers") lyr = arcpy.mapping.ListLayers(mxd,"Localities",df) arcpy.mapping.ExportReport(lyr,r"C:\temp\test.rlf",r"C:\temp\test.pdf","EXTENT",extent=df.extent) del mxd
Is there a way to have the Python AddIn not just create the PDF file but also open it in Adobe Acrobat Reader?