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

save printer used in a report

edited February 2002 in General
RB Ent 6.03, D5, W2k

I have an application that prints an invoice and a purchase order to 2
different printer. Invoice goes to dot matrix on preprinted stationery for
multiple copies, the purchase orders go to a laser. If the user forgets to
switch printers the output is useless. Is there a way to store which
printer was used for a report and also to set the printer back to the saved
one prior to printing ?

Comments

  • edited February 2002
    In the Report.OnPrintDialogClose event, you can read its Printer object to
    see what the user has configured. Save this to an .ini file. Then the next
    time the report is run, the Report.Printersetup.PrinterName can be
    configured beforehand to be the printer name located in the .ini file.

    uses
    ppPrintr;

    procedure TForm1.ppReport1PrintDialogClose(Sender: TObject);
    begin

    Showmessage(TppPrinter(ppReport1.PrintDialog.Printer).PrinterName);

    end;


    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited February 2002
    Thanx

This discussion has been closed.