meekdav85

Arcpy Export report error

Discussion created by meekdav85 on Apr 16, 2013
Latest reply on Nov 30, 2015 by deleted-user-mezzanRtr2IZ
Hello all,

I'm working on trying to use arcpy to automate the creation of a report, but I'm running into a problem.

  
>>> arcpy.mapping.ExportReport('2013pp',"C:\reports\2013_Graffiti.rlf","C:\reports\2013_Graffiti_report.pdf")

    Runtime error 
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "c:\program files\arcgis\desktop10.1\arcpy\arcpy\utils.py", line 181, in fn_
        return fn(*args, **kw)
      File "c:\program files\arcgis\desktop10.1\arcpy\arcpy\mapping.py", line 506, in ExportReport
        assert isinstance(report_source, (MapDocument, TableView, Layer)), str(type(report_source))
    AssertionError: <type 'str'>


I'm having trouble deciphering the traceback as it seems to reference a variety of internal python files. In trouble shooting so far, I thought the problem might be that the report_source needs to be a layer file and I was using a .shp so I converted to a .lyr but then I get the error:

    Parsing error SyntaxError: invalid syntax (line 1)


Any advice would be greatly appreciated,
Best,
David

Outcomes