Creating a report for a holiday lights system. Residents submit pictures, comments and address to the communications department. We run scripts to create a point FC from addresses and manage the publishing of the service on a nightly basis. We have a web app that lets users see the pictures, download pdfs showing the pictures with a map of the location and provide routing if they wish. We have maps generated with Data Driven Pages to create these pdfs. We want to add a report that shows the homes in a more condensed format. See the attached image for the report that was created within ArcMap. I want to export that with python but I get an error:
<SPAN class="keyword token">print</SPAN> <SPAN class="string token">'exporting summary report...'</SPAN>
report_MapDoc <SPAN class="operator token">=</SPAN> <SPAN class="string token">"\\\\netapp02\\data\\vol4\\mis\\GIS\\Enterprise\\MapDocs\\misgis0290\\HolidayLights.mxd"</SPAN>
report_Layout <SPAN class="operator token">=</SPAN> <SPAN class="string token">"\\\\netapp02\\data\\vol4\\mis\\GIS\\Enterprise\\MapDocs\\misgis0290\\HolidayLights.rlf"</SPAN>
report_Output <SPAN class="operator token">=</SPAN> <SPAN class="string token">"\\\\pslgis-vm\\webapp\\com\\HolidayLights\\images\\LightsReport.pdf"</SPAN>
reportMxd <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>mapping<SPAN class="punctuation token">.</SPAN>MapDocument<SPAN class="punctuation token">(</SPAN>report_MapDoc<SPAN class="punctuation token">)</SPAN>
df <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>mapping<SPAN class="punctuation token">.</SPAN>ListDataFrames<SPAN class="punctuation token">(</SPAN>reportMxd<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN>
lyr <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>mapping<SPAN class="punctuation token">.</SPAN>ListLayers<SPAN class="punctuation token">(</SPAN>df<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>Delete_management<SPAN class="punctuation token">(</SPAN>report_Output<SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">print</SPAN> lyr
arcpy<SPAN class="punctuation token">.</SPAN>mapping<SPAN class="punctuation token">.</SPAN>ExportReport<SPAN class="punctuation token">(</SPAN>lyr<SPAN class="punctuation token">,</SPAN> report_Layout<SPAN class="punctuation token">,</SPAN> report_Output<SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
and I get this error
Traceback (most recent call last):
File "C:\PythonUpdateScripts\UpdateHolidayLights.py", line 279, in <module>
main()
File "C:\PythonUpdateScripts\UpdateHolidayLights.py", line 255, in main
arcpy.mapping.ExportReport(lyr, report_Layout, report_Output)
File "C:\Program Files (x86)\ArcGIS\Desktop10.5\ArcPy\arcpy\utils.py", line 182, in fn_
return fn(*args, **kw)
File "C:\Program Files (x86)\ArcGIS\Desktop10.5\ArcPy\arcpy\mapping.py", line 532, 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<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
If I remove the picture on the right for each record, the report runs as expected. Is this a limitation of using arcpy.mapping and reporting?