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

OnStartPage <> Collation

edited August 2006 in General
Hi,

We have a report with the number of copies fi set to 4. We want to print
'DUPLICATE' on the page from starting the 2nd copie, we use the OnStartPage
event to increase a variable to distiguish the first from the x copy. When
collate is set to True this works DUPLICATE is printed from the 2nd copy on.
Now when collate is set to False DUPLICATE isn't printed from the 2nd copy
on. because the OnStartPage only is fired for the 1st copy.

Copies = 4
Collate = True OnStartPage fires 4 times
Collate = False OnStartPage fires only once

We need some (print 'DUPLICATE' from 2nd copie on) functionality that works
both for Collate True/False.

Greetings,
Filip Moons

Comments

  • edited August 2006
    Hi Filip,

    You can work around this by using the OnStartPage event of the Printer
    Device. Take a look a the following example.

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


    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited August 2006
    Hi Nico,

    -The ''Copy ' + IntToStr(FCopy)' from the sample is a TppDBText component
    which may be dropped or not on some band on the report , the report design
    is controlled by the enduser.
    - Further more each report design (Invoice) can be a different (dynamically
    loaded design from the db). Fi: 5 invoices to be printed can be 5 different
    report designs.

    How do i simulate the TppDBText component if it exist on the report to the
    drawcommand i need in the PrinterDevice.OnStartPage. Isn't there any easier
    way doing this?

    Greetings,
    Filip Moons

  • edited August 2006
    One other thing. Let's say we have 1 invoice to be printed which is spreaded
    over 2 pages. I need 1 extra copie which mentions 'COPY', in total 4 pages
    will be printed. So i need to add a drawcommand for page 3 only which
    contains the headerband for the extra copie. How do i find out in the
    ppReport1.PrinterDevice.OnStartPage event on which individual page i need to
    add the 'COPY' drawcommand?


  • edited August 2006
    Hi Filip,


    The sample uses a TppDrawText component, not a DBText. Are you speaking
    about your application? Do you offer your users a custom component of some
    sort that shows a unique caption for each copy? If so, the concept is the
    same, you will need to somehow recognize that his component has been placed
    on your report (perhaps using a report object loop), then manually add that
    text to each copy using OnStartPage event.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited August 2006
    Hi Filip,

    If I understand collation correctly, printing a two page report with
    collation turned off will print in the following order...

    1. Page 1
    2 .Page 1 (copy)
    3. Page 2
    4. Page 2 (copy)

    You will need to add a drawcommand to page 2 and page 4. The example resets
    the FCopy variable each time the proper amount of copies has been printed.
    Perhaps I do not understand what you are asking?

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

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