Export with ActiveReports 1.0

Posted by: frizzo1 on 4 August 2017, 3:01 pm EST

  • Posted 4 August 2017, 3:01 pm EST

    Yeah, it's ancient history, but it's been working fine in an enterprise app for almost 10 years. <br>Anyway, a question.  I am trying to export a report to PDF without first displaying it in the ArViewer control.  I can't seem to make it work.  The standard line:<br><br>    Set oPDF = New ARExportPDF<br>    oPDF.FileName = strFileName<br>    ReportInstance.Export oPDF<br><br>does not work (e.g. generates a 1kb file).  However, if I let the report first generate and display in ArViewer control, the code above works great.  Am I missing something simple?<br><br>So far my workaround has been to place an ArViewer control on the form behind some other control, watch for Report_End event on the report instance and then run the Export.  There has got to be a better way.<br><br>Thanks.<br>
  • Replied 4 August 2017, 3:01 pm EST

    Do you get the result if you export using the Export method of export object instead?<br><br><font face="Courier New">oPDF.Export ReportInstance.Pages<br><br><font face="Times New Roman">You do not need a viewer when place your code (or the alternative above) in the ReportEnd event of the report.</font><br></font>
  • Replied 4 August 2017, 3:01 pm EST

    <P>Make sure your report runs before you attempt to export the pages collection.</P>
    <P>Set oPDF = New ARExportPDF<BR>oPDF.FileName = strFileName<BR><FONT>ReportInstance.Run False<BR></FONT>ReportInstance.Export oPDF</P>
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels