<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Arcpy Export report error in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/arcpy-export-report-error/m-p/604475#M20060</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am experiencing problems with arcpy.mapping.Exportreport as well since my desktop was updated to 10.2.1 earlier this week. I am attempting to export a .pdf report but encounter the follwing error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; File "C:\Users\Jeff\Documents\WORK\RECOVER\GetFireReportsData.py", line 69, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; arcpy.mapping.ExportReport(lyr, rlf, (r"C:/Data/RECOVER2/" + fireName + "Fire_detailed.pdf"))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\utils.py", line 181, in fn_&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; return fn(*args, **kw)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\mapping.py", line 515, in ExportReport&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; 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))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;RuntimeError: Error in generating report&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is the function, pretty simple. It was working fine and the .pdf report was successfully generating last week when I was running 10.2.0. Can anybody tell me what is going on (mind that this is just part of a larger program, obviously I have imported arcpy.)?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;lyr = arcpy.mapping.Layer("&amp;lt;path&amp;gt;")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;rlf = ("&amp;lt;path&amp;gt;")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.mapping.ExportReport(lyr, rlf, "&amp;lt;path&amp;gt;_detailedReport.pdf")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Apologies for remaining vague. I must repeat, this was working prior to the 10.2.1 update.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 28 Mar 2014 21:51:12 GMT</pubDate>
    <dc:creator>deleted-user-mezzanRtr2IZ</dc:creator>
    <dc:date>2014-03-28T21:51:12Z</dc:date>
    <item>
      <title>Arcpy Export report error</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcpy-export-report-error/m-p/604472#M20057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm working on trying to use arcpy to automate the creation of a report, but I'm running into a problem. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;PRE class="plain" name="code"&gt;&amp;gt;&amp;gt;&amp;gt; arcpy.mapping.ExportReport('2013pp',"C:\reports\2013_Graffiti.rlf","C:\reports\2013_Graffiti_report.pdf")

&amp;nbsp;&amp;nbsp;&amp;nbsp; Runtime error 
&amp;nbsp;&amp;nbsp;&amp;nbsp; Traceback (most recent call last):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; File "&amp;lt;string&amp;gt;", line 1, in &amp;lt;module&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; File "c:\program files\arcgis\desktop10.1\arcpy\arcpy\utils.py", line 181, in fn_
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return fn(*args, **kw)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; File "c:\program files\arcgis\desktop10.1\arcpy\arcpy\mapping.py", line 506, in ExportReport
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; assert isinstance(report_source, (MapDocument, TableView, Layer)), str(type(report_source))
&amp;nbsp;&amp;nbsp;&amp;nbsp; AssertionError: &amp;lt;type 'str'&amp;gt;&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Parsing error SyntaxError: invalid syntax (line 1)&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any advice would be greatly appreciated,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Best,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;David&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Apr 2013 13:55:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcpy-export-report-error/m-p/604472#M20057</guid>
      <dc:creator>DavidMeek</dc:creator>
      <dc:date>2013-04-16T13:55:51Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy Export report error</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcpy-export-report-error/m-p/604473#M20058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It's a problem with the file path strings.&amp;nbsp; Python is picky about the "slashes".&amp;nbsp; You have to either switch your "\" to "\\" or "/" or throw an "r" in front of the existing strings as you have them now.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"C:\\reports\\2013_Graffiti.rlf","C:\\reports\\2013_Graffiti_report.pdf"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;OR&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"C:/reports/2013_Graffiti.rlf","C:/reports/2013_Graffiti_report.pdf"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;OR&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;r"C:\reports\2013_Graffiti.rlf",r"C:\reports\2013_Graffiti_report.pdf"&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jun 2013 15:12:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcpy-export-report-error/m-p/604473#M20058</guid>
      <dc:creator>ToddLusk</dc:creator>
      <dc:date>2013-06-20T15:12:44Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy Export report error</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcpy-export-report-error/m-p/604474#M20059</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The first argument to exportreport must be an arcpy.mapping object. For example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;mxd = arcpy.mapping.MapDocument('current')
df = arcpy.mapping.ListDataFrames(mxd, 'Layers')[0]
layer = arcpy.mapping.ListLayers(df, '2013pp')[0]
arcpy.mapping.ExportReport(layer,"C:\reports\2013_Graffiti.rlf","C:\reports\2013_Graffiti_report.pdf")&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:55:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcpy-export-report-error/m-p/604474#M20059</guid>
      <dc:creator>JasonScheirer</dc:creator>
      <dc:date>2021-12-12T01:55:23Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy Export report error</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcpy-export-report-error/m-p/604475#M20060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am experiencing problems with arcpy.mapping.Exportreport as well since my desktop was updated to 10.2.1 earlier this week. I am attempting to export a .pdf report but encounter the follwing error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; File "C:\Users\Jeff\Documents\WORK\RECOVER\GetFireReportsData.py", line 69, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; arcpy.mapping.ExportReport(lyr, rlf, (r"C:/Data/RECOVER2/" + fireName + "Fire_detailed.pdf"))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\utils.py", line 181, in fn_&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; return fn(*args, **kw)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\mapping.py", line 515, in ExportReport&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; 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))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;RuntimeError: Error in generating report&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is the function, pretty simple. It was working fine and the .pdf report was successfully generating last week when I was running 10.2.0. Can anybody tell me what is going on (mind that this is just part of a larger program, obviously I have imported arcpy.)?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;lyr = arcpy.mapping.Layer("&amp;lt;path&amp;gt;")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;rlf = ("&amp;lt;path&amp;gt;")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.mapping.ExportReport(lyr, rlf, "&amp;lt;path&amp;gt;_detailedReport.pdf")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Apologies for remaining vague. I must repeat, this was working prior to the 10.2.1 update.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Mar 2014 21:51:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcpy-export-report-error/m-p/604475#M20060</guid>
      <dc:creator>deleted-user-mezzanRtr2IZ</dc:creator>
      <dc:date>2014-03-28T21:51:12Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy Export report error</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcpy-export-report-error/m-p/604477#M20062</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;lyr = arcpy.mapping.Layer("&amp;lt;path&amp;gt;")&lt;/P&gt;&lt;P&gt;arcpy.mapping.ExportReport(inTable, ... &lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Is &amp;lt;path&amp;gt; a table or feature class? If so this won't work, you need to create a layer object.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Nov 2015 08:23:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcpy-export-report-error/m-p/604477#M20062</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2015-11-26T08:23:58Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy Export report error</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcpy-export-report-error/m-p/604478#M20063</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;report_src in arcpy.ExportReport() can be reference to layer file or a table view. I am utilizing the former in this example.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Nov 2015 15:56:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcpy-export-report-error/m-p/604478#M20063</guid>
      <dc:creator>deleted-user-mezzanRtr2IZ</dc:creator>
      <dc:date>2015-11-30T15:56:25Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy Export report error</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcpy-export-report-error/m-p/604479#M20064</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Apologies upfront.&amp;nbsp; Being over a year ago, I can't recall exactly what was done to resolve this.&amp;nbsp; I did learn that ExportReport will not support background processing and it did not seems to like being a part of a stand alone Python script either.&amp;nbsp; I was able to execute this funtion by turning off background processing and running the script via a ArcMap Script Tool.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Nov 2015 15:58:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcpy-export-report-error/m-p/604479#M20064</guid>
      <dc:creator>deleted-user-mezzanRtr2IZ</dc:creator>
      <dc:date>2015-11-30T15:58:30Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy Export report error</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcpy-export-report-error/m-p/604480#M20065</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, this did the trick for me as well. Not sure though why this function works better within an ArcMap environment rather then running as a standalone script.&lt;/P&gt;&lt;P&gt;Thanks for the help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Feb 2020 18:55:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcpy-export-report-error/m-p/604480#M20065</guid>
      <dc:creator>PatrickSeastar</dc:creator>
      <dc:date>2020-02-15T18:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy Export report error</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/arcpy-export-report-error/m-p/604476#M20061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you ever find a solution to this problem? I'm using 10.3 but getting the same thing:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Runtime error
Traceback (most recent call last):
&amp;nbsp; File "&amp;lt;string&amp;gt;", line 1, in &amp;lt;module&amp;gt;
&amp;nbsp; File "N:/13057/13057.3/Production/InspectionOnCall/Testing/PDF Generation Testing.py", line 14, in &amp;lt;module&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; generateReports("VPS-030")
&amp;nbsp; File "N:/13057/13057.3/Production/InspectionOnCall/Testing/PDF Generation Testing.py", line 12, in generateReports
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.mapping.ExportReport(inTable, template, "workOrder" + str(workOrderID) + ".pdf", "DEFINITION_QUERY", "Baltimore County DPW Bureau of Utilies On-call Contract Management", report_definition_query="SELECT * FROM tbl_Asset_Tracking WHERE WorkOrder = " + str(workOrderID))
&amp;nbsp; File "c:\program files\arcgis\desktop10.3\arcpy\arcpy\utils.py", line 182, in fn_
&amp;nbsp;&amp;nbsp;&amp;nbsp; return fn(*args, **kw)
&amp;nbsp; File "c:\program files\arcgis\desktop10.3\arcpy\arcpy\mapping.py", line 532, in ExportReport
&amp;nbsp;&amp;nbsp;&amp;nbsp; 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&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:55:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/arcpy-export-report-error/m-p/604476#M20061</guid>
      <dc:creator>MichaelMattaini1</dc:creator>
      <dc:date>2021-12-12T01:55:26Z</dc:date>
    </item>
  </channel>
</rss>

