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

Number of copies printed

edited February 2006 in General
I need to count the number of copies printed from the print screen.

eg clients selects 3 copies and prints (Copies := 3)
he then selects another 4 copies and print (Copies := 7)

This could happen before the client closes the print dialogue.

Steve W

Comments

  • edited February 2006
    Hi Steve,

    You can access the edtCopies edit box using the TppReport.PrintDialog
    property. Inside the OnBeforePrint event perhaps, you could check this
    value and update a global variable elsewhere keeping track of all copies
    made.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited February 2006
    Thanks for the help so far.

    I use the following code


    form1.pcnnew :=
    ppReport_ppreport_tickets_dot_Matrix.PrinterSetup.Copies;
    form1.pcnnew := form1.pcnold + form1.pcnnew;
    datamodule7.Table_Sites.edit;
    datamodule7.Table_Sites.FieldByName('PCN').AsInteger := form1.pcnnew;
    datamodule7.Table_Sites.post;

    The report prints a ticket with location code eg 517 - 001(pcnnew)
    I have tried this on onbeforeprint,onbeforegenerate,onafterprint and
    onaftergenerate
    When printing the number of copies defaults to 3.
    This automatically adds 3 to the pcnnew values and prints 3 tickets as
    517- 004

    I am trying to produce 517-002 517-003 517-004

    Which event should I place this code please.

    Steve W


  • edited February 2006
    Hi Steve,

    The PrinterSetup.Copies property will remain the same for each copy printed.
    You will need to keep track of the copy that is being printed in a global
    variable in your application in order to add the copy number to the table in
    your DB. Take a look at the following example of creating a unique caption
    on the report for each copy. You will need to use the same concept in your
    case...

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

    --
    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.