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.
    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:

        Set oPDF = New ARExportPDF
        oPDF.FileName = strFileName
        ReportInstance.Export oPDF

    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?

    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.

    Thanks.
  • Replied 4 August 2017, 3:01 pm EST

    Do you get the result if you export using the Export method of export object instead?

    oPDF.Export ReportInstance.Pages

    You do not need a viewer when place your code (or the alternative above) in the ReportEnd event of the report.
  • Replied 4 August 2017, 3:01 pm EST

    Make sure your report runs before you attempt to export the pages collection.


    Set oPDF = New ARExportPDF
    oPDF.FileName = strFileName
    ReportInstance.Run False
    ReportInstance.Export oPDF

Need extra support?

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

Learn More

Forum Channels