Home General

Printer setup on second report

edited April 2010 in General
RB version 10.08

I'm printing two reports one after the other with ShowPrintDialog true on
the first and false on the second. I need to transfer the printer selection
from the first dialog to the second report. I understand the printer name
is not saved in the first report's PrinterSetup properties and, according to
previous posts, I need to get the printer name from the first report's
PrintDialog properties.

Am I on-track and exactly how do you do that? Where is the printer name in
the PrintDialog?

Thanks
--
Bill Skelton

Landmark Data Systems, Inc.
Two Old River Place, Suite L
Jackson, MS 39202-3435
601-362-0303

Comments

  • edited April 2010
    Hi Bill,

    Try accessing the PrintDialog.Printer.PrinterSetup property. This is what
    gets assigned to the report after the print dialog closes.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited April 2010
    Sorry to be so thickheaded Nico.

    ppReport.PrintDialog.Printer.PrinterSetup.PrinterName ??? (no PrinterSetup
    property in Printer)
    Am I missing a unit in my uses statement?

    Bill

  • edited April 2010
    Hi Bill,

    Sorry, the Printer property is a TObject type (most likely to avoid circular
    references). Your code would look something like the following...

    uses
    ppPrintr;


    lsPrinterName :=
    TppPrinter(ppReport1.PrintDialog.Printer).PrinterSetup.PrinterName;

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited April 2010
    Got it! I had to assign lsPrinterName in the OnPrintDialogClose, I assume
    to catch it before the report was destroyed.

    Many thanks Nico.

This discussion has been closed.