POST
|
Wes - Brilliant! Works great. Thanks!! Can you elaborate on the logic behind needing the sql expression for ExportReport?
... View more
06-28-2016
05:11 AM
|
0
|
1
|
425
|
POST
|
import arcpy, os path = os.getcwd() mxd = arcpy.mapping.MapDocument("CURRENT") lyr = arcpy.mapping.ListLayers(mxd, "UNV.TEST")[0] fields = "GLUE_ID" with arcpy.da.SearchCursor(lyr, fields) as cursor: for row in cursor: play = (row[0]) arcpy.mapping.ExportReport(lyr, r"C:\\Bob\\ExecutiveSummary.rlf", r"C:\\Bob"+str(play)+".pdf", "DEFINITION_QUERY", report_definition_query="GLUE_ID="+str(play)) del mxd Yes the query alone returns the values of GLUE_ID.
... View more
06-27-2016
11:40 AM
|
0
|
0
|
425
|
POST
|
Wes - was just a typo on fields/Fields. Changed the field delimiters - thanks! Still getting problem with arcpy.mapping.ExportReport line. Here's error: Runtime error Traceback (most recent call last): File "<string>", line 9, in <module> File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\utils.py", line 181, in fn_ return fn(*args, **kw) File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\mapping.py", line 515, 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
... View more
06-27-2016
09:29 AM
|
0
|
1
|
425
|
POST
|
Trying to export individual report for each row in a layer. Seems the definition query piece is not working. Any ideas? Code is : import arcpy, os path = os.getcwd() mxd = arcpy.mapping.MapDocument("CURRENT") lyr = arcpy.mapping.ListLayers(mxd, "BOB.TEST")[0] fields = ['GLUE_ID'] with arcpy.da.SearchCursor(lyr, Fields) as cursor: for row in cursor: play = (row[0]) arcpy.mapping.ExportReport(lyr, r"C:\\Bob\\ExecutiveSummary.rlf", r"C:\\Bob"+str(play)+".pdf", "DEFINITION_QUERY", report_definition_query="GLUE_ID="+str(play)+"") del mxd
... View more
06-27-2016
08:44 AM
|
0
|
7
|
2963
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|