<?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: Creating a report in model Builder in Mapping Questions</title>
    <link>https://community.esri.com/t5/mapping-questions/creating-a-report-in-model-builder/m-p/172039#M1891</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;There isnt a 'Generate Report' GP tool. However, you can work around this by writing a bit of Python code - but you need a .lyr file and .rlf file - a report layout file. The .rlf would have to already exist, i.e. it would have to be pre-authored with the fields you want in the report. Then you would use arcpy.mapping.ExportReport - which is available at 10.1.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For the sake of demonstration in the script below, I simulate a model outputting a feature class by creating a new feature class using CopyFeatures.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcpy&amp;nbsp; arcpy.CopyFeatures_management(r'C:\TemplateData.gdb\USA\states', &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r'C:\TemplateData.gdb\USA\states2')&amp;nbsp; # Make a feature layer out of the feature class arcpy.MakeFeatureLayer_management(r'C:\TemplateData.gdb\USA\states2','MyTempLayer')&amp;nbsp; # Save the feature layer to a .LYR file arcpy.SaveToLayerFile_management('MyTempLayer','C:/temp/MyLayer.lyr')&amp;nbsp; # ExportReport needs a layer in a map doc or a .LYR file lyr = arcpy.mapping.Layer('C:/temp/MyLayer.lyr')&amp;nbsp; # Export the report to a common format, such as PDF arcpy.mapping.ExportReport(lyr, &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r"C:\Temp\MyRLF.rlf", &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r"C:\Temp\ProjectReport.pdf")&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Alternatively, you could export the feature class to a table (e.g. DBF) and then use third party Python libraries (like ReportLab) to export the table to a PDF report. Or create a report in the arcmap layout by moving and cloning text boxes - both of which can get complicated. There are a couple examples of this on resource center.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Otherwise, the reporting tools in UI would have to be used.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Nov 2012 21:42:53 GMT</pubDate>
    <dc:creator>JeffMoulds</dc:creator>
    <dc:date>2012-11-29T21:42:53Z</dc:date>
    <item>
      <title>Creating a report in model Builder</title>
      <link>https://community.esri.com/t5/mapping-questions/creating-a-report-in-model-builder/m-p/172037#M1889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have created a model that produces a feature class file containing an attribute table with fields and records that I would like to export in report format. I have tried searching for a generate report tool to add to my model but no luck. Does anyone know how to automate report generation from attribute data using model builder?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Nov 2012 20:21:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/creating-a-report-in-model-builder/m-p/172037#M1889</guid>
      <dc:creator>ShawnOliver</dc:creator>
      <dc:date>2012-11-29T20:21:37Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a report in model Builder</title>
      <link>https://community.esri.com/t5/mapping-questions/creating-a-report-in-model-builder/m-p/172038#M1890</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;youd probably have to create a separate script that creates a csv or txt file from a feature attribute\standalone table,then add it to your model.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Nov 2012 21:27:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/creating-a-report-in-model-builder/m-p/172038#M1890</guid>
      <dc:creator>ChrisPedrezuela</dc:creator>
      <dc:date>2012-11-29T21:27:33Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a report in model Builder</title>
      <link>https://community.esri.com/t5/mapping-questions/creating-a-report-in-model-builder/m-p/172039#M1891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;There isnt a 'Generate Report' GP tool. However, you can work around this by writing a bit of Python code - but you need a .lyr file and .rlf file - a report layout file. The .rlf would have to already exist, i.e. it would have to be pre-authored with the fields you want in the report. Then you would use arcpy.mapping.ExportReport - which is available at 10.1.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For the sake of demonstration in the script below, I simulate a model outputting a feature class by creating a new feature class using CopyFeatures.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcpy&amp;nbsp; arcpy.CopyFeatures_management(r'C:\TemplateData.gdb\USA\states', &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r'C:\TemplateData.gdb\USA\states2')&amp;nbsp; # Make a feature layer out of the feature class arcpy.MakeFeatureLayer_management(r'C:\TemplateData.gdb\USA\states2','MyTempLayer')&amp;nbsp; # Save the feature layer to a .LYR file arcpy.SaveToLayerFile_management('MyTempLayer','C:/temp/MyLayer.lyr')&amp;nbsp; # ExportReport needs a layer in a map doc or a .LYR file lyr = arcpy.mapping.Layer('C:/temp/MyLayer.lyr')&amp;nbsp; # Export the report to a common format, such as PDF arcpy.mapping.ExportReport(lyr, &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r"C:\Temp\MyRLF.rlf", &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r"C:\Temp\ProjectReport.pdf")&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Alternatively, you could export the feature class to a table (e.g. DBF) and then use third party Python libraries (like ReportLab) to export the table to a PDF report. Or create a report in the arcmap layout by moving and cloning text boxes - both of which can get complicated. There are a couple examples of this on resource center.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Otherwise, the reporting tools in UI would have to be used.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Nov 2012 21:42:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/creating-a-report-in-model-builder/m-p/172039#M1891</guid>
      <dc:creator>JeffMoulds</dc:creator>
      <dc:date>2012-11-29T21:42:53Z</dc:date>
    </item>
  </channel>
</rss>

