I'm trying to write a script to export a report that includes a map in the output pdf. While the script will create the pdf report and a separate .emf file, the script won't include the emf image in the pdf document. I have copy/pasted the example from the Desktop help (search for ExportReport to see to what I am referring to) with only minor edits to the script. See below:
import arcpy, os
path = os.getcwd()
pdfPath = path + r"\States_SubRegions.pdf"
if os.path.exists(pdfPath):
os.remove(pdfPath)
pdfDoc = arcpy.mapping.PDFDocumentCreate(pdfPath)
subRegionList = ["744","760"]
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)[0]
lyr = arcpy.mapping.ListLayers(mxd, "BuildingSpace_A")[0]
pageCount = 1
for region in subRegionList:
arcpy.mapping.ExportToBMP(mxd, path + "\RegionalPicture.bmp", df)
arcpy.mapping.ExportReport(report_source=lyr, report_layout_file=path + r"\custodial_areas.rlf", output_file=path + r"\temp" + str(pageCount) + ".pdf", dataset_option="USE_RLF",starting_page_number=pageCount)
pdfDoc.appendPages(path + r"\temp" + str(pageCount) + ".pdf")
pageCount = pageCount + 1
pdfDoc.saveAndClose()
del mxd
Maybe I don't understand the purpose of the script??
Your help is greatly appreciated and thanks in advance for any help.
Cheers
I'm using v. 10.3.1 for Desktop
32 bit windows with 32 bit ESRI