import arcpy cttable=arcpy.mapping.TableView(r"C:\Workspace\CaseTypeTables.gdb\AGR_SET_RECON_LN_case_types") arcpy.mapping.ExportReport(cttable,r"C:\Workspace\working\LAS_case-type_report.rlf",r"C:\Workspace\working\successPDFreport.pdf") del cttable
Solved! Go to Solution.
# import arcpy modules and geoprocessing tools import arcpy, os # not sure what this does from arcpy import env # enables the output to overwrite anything that was there before env.overwriteOutput = 1 # not sure what this does env.workspace = r"C:\Workspace\CaseTypeTables.gdb" #1sttables is a variable that contains a list of all the tables from casetypetables.gdb #what is the * for lstTables = arcpy.ListTables("*") #loop to run thru all the tables in 1sttables and execute the exportreport function from arcpy #table is a variable for a single table from 1sttable #cttable is a variable calling the arcpy funtion tableview to view the single table #the TRY command is executing the exportreport function on cttable using the report format from # LAS_case-type_report.rlf and exporting the resulting PDF at C:\workspace\. . . . for table in lstTables: cttable = arcpy.mapping.TableView(table) try: arcpy.mapping.ExportReport(cttable, r"C:\Workspace\working\LAS_case-type_report.rlf", r"C:\Workspace\working\_"+table+".pdf") except: arcpy.GetMessages()
import arcpy, os from arcpy import env env.overwriteOutput = 1 env.workspace = r"C:\Workspace\CaseTypeTables.gdb" lstTables = arcpy.ListTables("*") for table in lstTables: cttable = arcpy.mapping.TableView(table) try: arcpy.mapping.ExportReport(cttable, r"C:\Workspace\working\LAS_case-type_report.rlf", r"C:\Workspace\working\successPDFreport.pdf" + os.sep + table + "_PDFreport.pdf") except: arcpy.GetMessages()
# import arcpy modules and geoprocessing tools import arcpy, os # not sure what this does from arcpy import env # enables the output to overwrite anything that was there before env.overwriteOutput = 1 # not sure what this does env.workspace = r"C:\Workspace\CaseTypeTables.gdb" #1sttables is a variable that contains a list of all the tables from casetypetables.gdb #what is the * for lstTables = arcpy.ListTables("*") #loop to run thru all the tables in 1sttables and execute the exportreport function from arcpy #table is a variable for a single table from 1sttable #cttable is a variable calling the arcpy funtion tableview to view the single table #the TRY command is executing the exportreport function on cttable using the report format from # LAS_case-type_report.rlf and exporting the resulting PDF at C:\workspace\. . . . for table in lstTables: cttable = arcpy.mapping.TableView(table) try: arcpy.mapping.ExportReport(cttable, r"C:\Workspace\working\LAS_case-type_report.rlf", r"C:\Workspace\working\_"+table+".pdf") except: arcpy.GetMessages()