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

Duplicate Specific Pages

edited May 2003 in General
Hi

I have a report which prints invoices for customers. The design is :-

GROUP HEADER 1 showing the name, adddres etc
GROUP HEADER 2 showing 'Grouped' detail records
DETAIL showing invoice details and totals
GROUP FOOTER 2 showing Totals for 'Grouped' detail records
GROUP FOOTER 1 showing grand totals for all 'Grouped' detail records

This prints once per page.

GROUP HEADER 1
GROUP HEADER 2
DETAIL
GROUP FOOTER 2
GROUP FOOTER 1

Is there a way to have certain pages printed more than once ie duplicated.
I know I could do ppReport.PrinterSetup.Copies := x to print x copies of the
'Whole' report.

So, say the report consists of 5 pages. I would like to duplicate say pages
2 and 4. I have also tried setting DETAIL.PrintCount = 1 and
DETAIL.BandsPerRecord = x. However, GROUP FOOTER 1 does not print for each
of the DETAIL bands, as it only prints on the last DETAIL band.

Thanks Lee

Comments

  • edited May 2003
    Here is an example of doing this. What it does is let the report generate
    each page, and in the OnEndPage event, if this is a page to be copied, then
    a TppPage object is created and assign the draw commands that hte report has
    generated for the page and then sends the copied page to the device
    manually.

    http://www.digital-metaphors.com/tips/CopySelectedPages.zip


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited June 2003
    Hi Jim

    Many thanks for your reply last week.

    Is it possible to render the TppPage class to the TppScreenDevice instead of
    the TppPrinterDevice? The reason I ask, is that when the user calls the
    Report.Print, I have the device type set to dtScreen, and hence the report
    is displayed in the Preview Form.

    If it is possible to render to the screen object, when the user than selects
    the print button from within the Preview Form, I assume it will dispatch ALL
    pages to the PrinterDevice and not just the original pages. Is this
    correct?

    //eg
    //
    // {send page object to printer device}
    // ppReport1.PrinterDevice.IsMessagePage := False;
    // ppReport1.PrinterDevice.ReceivePage(lPage);
    //
    // should be :-
    //
    // ppReport1.ScreenDevice.IsMessagePage := False
    // ppReport1.PrinterDevice.ReceivePage(lPage);
    //


    Thanks Lee




  • edited June 2003
    You can call ReceivePage on the screen device, however, it may not work as
    the print preview interacts with the connected publisher when navigating
    pages, as a result of call Report.Print. It may not work the way you want it
    to. You should instead drop a TppViewer on the form and call
    Report.PrintToDevices if you want to control the pages that are sent to the
    screen.Basically, generate the report to cache by setting Report.CachePages
    to true and then requesting all of the pages with a TppDevice connected, so
    no output is made, just the pages are cache ready to go. Then you can
    respond to the user's NextPage button event handler on your custom form and
    then send a page from the cache to the TppViewer.ScreenDevice.


    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.