arcpy.mapping.ExportReport: Error in generating report

Discussion created by Oli01 on Feb 19, 2018
Latest reply on Feb 26, 2018 by Oli01


I am using ArcGIS 10.5 Basic.

I try to create an Report using Python. I always get an error. So finally I tried the Example 1 from the online-help (ExportReport—Help | ArcGIS Desktop ): I created a mxd with the File name C:\Project\Project.mxd, I created a Feature-Layer "Accidents" with some polygons. I created a report using VIEW > REPORTS > CREATE REPORT and saved it as "C:\Project\Project.rlf"

Finally I copied the code in a script  "C:\Users\or\Documents\ArcGIS\test1.py" and run.

This is the message:



Traceback (most recent call last):
  File "<string>", line 254, in run_nodebug
  File "C:\Users\or\Documents\ArcGIS\test1.py", line 8, in <module>
  File "C:\WinApps\CAD-GIS\GIS\ArcGIS\Desktop10.5\ArcPy\arcpy\utils.py", line 182, in fn_
    return fn(*args, **kw)
  File "C:\WinApps\CAD-GIS\GIS\ArcGIS\Desktop10.5\ArcPy\arcpy\mapping.py", line 532, in ExportReport
    return report_source._arc_object.ExportReport(*gp_fixargs((report_layout_file, output_file, dataset_option, report_title, starting_page_number, page_range, report_definition_query, extent, field_map), True))
RuntimeError: Error in generating report.

Any Idears?