AnsweredAssumed Answered

Export report tool box

Question asked by ilanazaria on Nov 16, 2014
Latest reply on Nov 16, 2014 by ilanazaria


Hi,

I try to build a tool that export report to pdf  file.

I used this example: ArcGIS Help 10.1 and I added parameters to a toolbox and write the python script:

 

# Date:    November 11, 2014
#          parameters:
#           1) Select Map Documents,

#             2) select data frame
#             3) Select Layer (points).
#            4) select report file (RLF).
#            5) Export report as pdf file.

import arcpy

#Read input parameters from script tool

#Select Map Documents
mxdPath = arcpy.GetParameterAsText(0)

#select data frame
dfName = arcpy.GetParameterAsText(1)

#  Select Layer (points).
feature = arcpy.GetParameterAsText(2)

#select RLF file
report= arcpy.GetParameterAsText(3)

#select PDF file name
exportfile= arcpy.GetParameterAsText(4)


mxd = arcpy.mapping.MapDocument(mxdPath)
df = arcpy.mapping.ListDataFrames(mxd, dfName)[0]
lyr = arcpy.mapping.ListLayers(mxd, feature, df)[0]
arcpy.mapping.ExportReport(lyr,report,exportfile)
                     
                          
del mxd

 

Error message:

error_report.png

Someone have an idea what can be the the reason for this error?

Outcomes