The online help for arcpy.mapping.ExportReport says that it has some restrictions on use but does not list 64bit machines amongst them.
I am running the following test from IDLE under ArcGIS 10.1 SP1 (with 64bit Background Geoprocessing installed) on Windows 7 SP1.
I've create a simple test.mxd (one layer called Suburbs in data frame called Layers) and a simple test.rlf (included Suburbs, said Finish to take all defaults, saw report and saved it as *.rlf)
However, this code (more or less straight from the Help example):
import arcpy
mxd = arcpy.mapping.MapDocument(r"C:\temp\test.mxd")
df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]
lyr = arcpy.mapping.ListLayers(mxd, "Suburbs", df)[0]
arcpy.mapping.ExportReport(lyr,
r"C:\temp\test.rlf",
r"C:\temp\test.pdf")
del mxd
throws this error:
Python 2.7.2 (default, Jun 12 2011, 14:24:46) [MSC v.1500 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> ================================ RESTART ================================
>>>
Traceback (most recent call last):
File "C:\temp\test.py", line 7, in <module>
r"C:\temp\test.pdf")
File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\utils.py", line 181, in fn_
return fn(*args, **kw)
File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\mapping.py", line 515, 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
>>>
Any thoughts on cause and/or possible workaround are welcome!
(My suspicion is that ExportReport may not be supported on 64bit machines.)
Best Answer
It will work on a 64 Bit Machine, yes, but only from the 32 bit Python interpreter. It is documented:
64-Bit Background geoprocessing is a stand-alone installation.