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

Skipping record or deleting page

edited March 2002 in General
Hello,

I'd like to know how I can Delete one or more page during the report
creation (using some event of the reports) or how to skip record depending
on calculation.

My problem is that I'll only know if a page should be in the report while
computing it. (Showing the page depends on calculation performed in
different events). So what I'd like to do is generate all the page of my
report and while generating it, store the page number that will be delete
before showing or printing the report. Is this possible ?

I'm using D5, Rbuilder 4.11

Thanks in advance
Greg

Comments

  • edited March 2002
    You'll need to generate the report to memory, then only send the pages that
    you want to send to the output device. Create a list of TppPage objects.
    Loop throught the report.Publisher's page objects and copy the draw commands
    with TppPage.Assign() for the pages that you want to print which exclude the
    deleted pages. When you add the pages to the TList, you'll need to update
    the page counts on the page objects. Then call the publisher's recieve page
    method so that it will add the page to its list of pages. Then the pages can
    be written to an archive file. Now you can read the archive file which has
    only the pages that you want, and it can be printed to the screen or to the
    printer. A similar demo which uses some of these techniques can be found
    here:
    http://www.digital-metaphors.com/tips/Booklet.zip
    http://www.digital-metaphors.com/tips/SpreadSheetStyleReport.zip


    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited March 2002
    Thanks for your quick answer :o)

    Greg
This discussion has been closed.