Create Report Macro

634
1
02-28-2012 10:25 PM
DuaneEckert
New Contributor
Hello,

I only have a basic knowledge of creating macros in ArcMap and need to create a macro that can generate a report from a shapefile's attributes, format it to set specifications (like you do in the options dialog box when creating a report, but all these reports will use the same settings) and then embed it onto a map composition. I want to automate it with a macro because it is something I have to do many times a day, everyday. I have created a userform in VBA that has 2 buttons to generate the 2 different formated reports I need, now I just need the hard part...the code. Any help would be very appreciated.

Thanks
Tags (2)
0 Kudos
1 Reply
JeffBarrette
Esri Regular Contributor
At 10.0 building reports with arcpy scripting can be very challenging, but possible, because you would need to set up all the elements in an MXD and automate their dynamic values and placement.  The following sample does something similar with dynamic tables:

http://resources.arcgis.com/gallery/file/geoprocessing/details?entryID=8C8E6EB6-1422-2418-A0B8-6AA61...

You could also use 3rd party Python site packages like ReportLab.  It is used in the following example:

http://resources.arcgis.com/gallery/file/geoprocessing/details?entryID=FBE3D235-1422-2418-8820-E071E...

FYI - At 10.1, we've extended the arcpy.mapping API to include ExportReport.  The ExportReport function provides a mechanism to automate the generation of reports that are originally authored in a map document (.mxd) using the reporting tools available in ArcMap.

Jeff
0 Kudos