Home General

More efficient export to file process?

edited March 2016 in General
Most of the time our application's reports output to a custom print
preview form, so that users can review them; if its a quote or invoice
type report they will then click our custom email button which generates
a PDF file for sending via our email interface. All well and good. But
the way I do this is to pass the report object to an export routine
which creates a TppPDFDevice, sets the devices publisher to the report's
publisher, and then calls Report.PrintToDevices (all standard stuff).
But this means that effectively the report publishing process (which can
take a while for complex quote reports) happens TWICE (once to screen,
then to file), and its tedious for the user to have to wait for the PDF
file to be generated. Is this the only way, or can a file be quickly
generated from all the work that has already gone into generating the
preview output?

TIA, Paul

P.S. v16.03 (still haven't installed my copy of v17 yet!)

Comments

  • edited March 2016
    Hi Paul,

    One option would be to export your report to an Archive and
    preview/print/export/email from there. This way you are only actually
    generating the report once (accessing data, generating pages and
    drawcommands). This would disable all live data features such as
    Autosearch however.

    1. Export your report to Archive file or stream.
    2. Preview the archive using a TppArchiveReader.
    3. From there you can then print/export your report as you would with a
    TppReport.

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.