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

Archive device and PageRequest (D6 RB10 Win XP)

edited September 2009 in Devices
Hi

I have been using the Archive device to produce a copy of a report which is
then filled into the database. This works well so I have no problem with
that.

I have recently created a batch printing area in my application which can
take a number of bookings and allow the user to print the documentation for
each with just a single click on a Print button and a single print dialog
usage.

Now the problem is that I am using the Print Dialog onClose event to add the
archive device and in that call I use clrMain.PrintDialog.PageRequest (where
clrMain is a TrsClientReport). But if I have say 10 bookings I only show the
dialog once and therefore cannot access the page request for the second,
third etc. print as the dialog has gone and I get an access violation if I
try.

Is there a way of preserving this page request object or is there another
property I can use that does not require the print dialog.

Regards
Andrew Wood

Comments

  • edited September 2009

    TppDevice.PageRequest is a public property. TppDevice is the ancestor of all
    output devices (Printer, Screen, File, etc)

    Try using the AfterPrint event to check

    if (myReport.PrinterDevice <> nil) then // report printed to printer
    lPageRequest := myReport.PrinterDevice.PageRequest


    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited September 2009
    Nard

    Tried it but got an acces viol. I then set it up in the before print and it
    worked great.

    Thanks for that.


  • edited September 2009

    Excellent .

    Yeah, I was sure about the timing of using AfterPrint.

    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

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