<?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: Export Report To PDF in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/export-report-to-pdf/m-p/1108673#M7248</link>
    <description>&lt;P&gt;yes... it was "OutFileName" in quotes instead of the variable. Thanks.&lt;/P&gt;</description>
    <pubDate>Tue, 19 Oct 2021 01:49:50 GMT</pubDate>
    <dc:creator>MichaelKohler</dc:creator>
    <dc:date>2021-10-19T01:49:50Z</dc:date>
    <item>
      <title>Export Report To PDF</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/export-report-to-pdf/m-p/1107949#M7236</link>
      <description>&lt;P&gt;Developing and ArcPro add in and cant get the ExportToPDF to work for my report. I can export it from Share-&amp;gt;ExportReport no problem. But doesn't work in code. No errors or anything. Code runs through just fine but no pdf is ever created. I found the code here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/arcgis-pro-sdk/wiki/ProSnippets-Reports#export-report-to-pdf" target="_blank" rel="noopener"&gt;https://github.com/Esri/arcgis-pro-sdk/wiki/ProSnippets-Reports#export-report-to-pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the code being used.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;private async void CnclReport_Click(object sender, RoutedEventArgs e)
        {            
            System.Windows.Forms.SaveFileDialog saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
            saveFileDialog1.Filter = "PDF File|*.pdf";
            saveFileDialog1.Title = "Save a PDF File";
            saveFileDialog1.FileName = "CouncilReport.pdf";
            saveFileDialog1.ShowDialog();

            if (saveFileDialog1.FileName != "")
            {
                await QueuedTask.Run(() =&amp;gt;
                {
                    ReportProjectItem reportProjItem = Project.Current.GetItems&amp;lt;ReportProjectItem&amp;gt;().FirstOrDefault(item =&amp;gt; item.Name.Equals("CouncilReport"));
                    Report report = reportProjItem?.GetReport();
                    var exportOptions = new ReportExportOptions
                    {
                        ExportPageOption = ExportPageOptions.ExportAllPages,
                        TotalPageNumberOverride = 0
                    };                    
                    PDFFormat pdfFormat = new PDFFormat();
                    pdfFormat.Resolution = 300;
                    pdfFormat.OutputFileName = saveFileDialog1.FileName;
                    report.ExportToPDF("CouncilReport", pdfFormat, exportOptions, false);
                });
            }            
            else
            {
                MessageBox.Show("Please provide a file name");
            }
            MessageBox.Show("exported");
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-edit&lt;/P&gt;&lt;P&gt;Instead of trying to do it that way, I used a GP Tool. Found this from:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/arcgis-pro-sdk/wiki/ProConcepts-Geoprocessing" target="_blank"&gt;https://github.com/Esri/arcgis-pro-sdk/wiki/ProConcepts-Geoprocessing&lt;/A&gt;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var progDlg = new ProgressDialog("Exporting Council Report", "Cancel", 100, true);
progDlg.Show();
var progsrc=new CancelableProgressorSource(progDlg);
var parameters = Geoprocessing.MakeValueArray("CouncilReport", saveFileDialog1.FileName);                
await Geoprocessing.ExecuteToolAsync("management.ExportReportToPDF", parameters, null, new CancelableProgressorSource(progDlg).Progressor, GPExecuteToolFlags.Default);
progDlg.Hide();&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 20:15:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/export-report-to-pdf/m-p/1107949#M7236</guid>
      <dc:creator>MichaelKohler</dc:creator>
      <dc:date>2021-10-15T20:15:37Z</dc:date>
    </item>
    <item>
      <title>Re: Export Report To PDF</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/export-report-to-pdf/m-p/1108405#M7242</link>
      <description>&lt;P&gt;Hi Michael,&lt;/P&gt;&lt;P&gt;As a work around, please specify the full path (including the filename) to the ExportToPDF method.&amp;nbsp; This works for me.&lt;/P&gt;&lt;P&gt;Looks like "OutFileName" property on the PDFFormat is being ignored. I will follow up on this one with the Report team.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Uma&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;report.ExportToPDF($@"C:\Users\UserName\Documents\ArcGIS\reportnew.pdf", pdfFormat, exportOptions, false);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 18 Oct 2021 14:15:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/export-report-to-pdf/m-p/1108405#M7242</guid>
      <dc:creator>UmaHarano</dc:creator>
      <dc:date>2021-10-18T14:15:41Z</dc:date>
    </item>
    <item>
      <title>Re: Export Report To PDF</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/export-report-to-pdf/m-p/1108673#M7248</link>
      <description>&lt;P&gt;yes... it was "OutFileName" in quotes instead of the variable. Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Oct 2021 01:49:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/export-report-to-pdf/m-p/1108673#M7248</guid>
      <dc:creator>MichaelKohler</dc:creator>
      <dc:date>2021-10-19T01:49:50Z</dc:date>
    </item>
  </channel>
</rss>

