Solved! Go to Solution.
import arcpy arcpy.CopyFeatures_management(r'C:\TemplateData.gdb\USA\states', r'C:\TemplateData.gdb\USA\states2') # Make a feature layer out of the feature class arcpy.MakeFeatureLayer_management(r'C:\TemplateData.gdb\USA\states2','MyTempLayer') # Save the feature layer to a .LYR file arcpy.SaveToLayerFile_management('MyTempLayer','C:/temp/MyLayer.lyr') # ExportReport needs a layer in a map doc or a .LYR file lyr = arcpy.mapping.Layer('C:/temp/MyLayer.lyr') # Export the report to a common format, such as PDF arcpy.mapping.ExportReport(lyr, r"C:\Temp\MyRLF.rlf", r"C:\Temp\ProjectReport.pdf")
import arcpy arcpy.CopyFeatures_management(r'C:\TemplateData.gdb\USA\states', r'C:\TemplateData.gdb\USA\states2') # Make a feature layer out of the feature class arcpy.MakeFeatureLayer_management(r'C:\TemplateData.gdb\USA\states2','MyTempLayer') # Save the feature layer to a .LYR file arcpy.SaveToLayerFile_management('MyTempLayer','C:/temp/MyLayer.lyr') # ExportReport needs a layer in a map doc or a .LYR file lyr = arcpy.mapping.Layer('C:/temp/MyLayer.lyr') # Export the report to a common format, such as PDF arcpy.mapping.ExportReport(lyr, r"C:\Temp\MyRLF.rlf", r"C:\Temp\ProjectReport.pdf")