Home Devices
New Blog Posts: Merging Reports - Part 1 and Part 2

pdf or printer selection for each page

edited August 2005 in Devices
I generate the month invoices all with the same report (it can be several
pages) and for some customers I must send invoce trought email e not
stardard mail.
So half page of this report will be printed to selected printer and the
other will be saved to pdf file and after send via outlook.

How can I do this automatic selection during printing ? (i've a switch that
tell to me if this page must be pdf or printed)

I've RB 7.02 and TExtraDevices.

thanks

Comments

  • edited August 2005


    Check out demo 124 (dm0124.pas) in RBuilder\Demos\Reports\Demo.dpr. It shows
    how to print a list of pages.

    Each device (PDF, Printer) can have its own list of pages that it request be
    generated.


    --
    Nard Moseley
    Digital Metaphors Corporation
    http://www.digital-metaphors.com



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited August 2005

    perfect !

    only another question : i need to create a different pdf file for each
    page. how can i do ?

    thanks a lot



  • edited August 2005

    You can use the Report.PrintToDevices method to print to any number of
    devices simultaneously. Each device can each request which page(s) its need
    to receive.

    Therefore, you need to create a separate TppPDFDevice instance for each file
    that you need to generate. Configure the device to request the appropriate
    page(s) and connect it to the report.Publisher. Then call PrintToDevices.



    --
    Nard Moseley
    Digital Metaphors Corporation
    http://www.digital-metaphors.com



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited August 2005

    but before i need to know how many pages i have and which of them i must
    print....
    so i can create a "hidden" device to generate pages a first time , and after
    this re-generate to pdf device to save pdf extrernal file.
    it is right ?

    how "hidden" device can i use ?


  • edited August 2005

    Try this...

    - set Report.CachePages to True
    - create a TppDevice and connect to the report's publisher
    - call PrintToDevices

    This will generate all pages and the report's publisher will cache them
    internally. TppDevice will not do anything (it is the ancestor of all
    Devices and does not generate any ouput).

    - free the TppDevice

    Create the PDFDevices, connect to report's publisher and call PrintToDevices
    again


    --
    Nard Moseley
    Digital Metaphors Corporation
    http://www.digital-metaphors.com



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.