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

Ability to Save PrinterSetup when report is printed

edited February 2002 in General
I am trying to save the PrinterSetup when a user prints a report to allow my
program to automatically send it to the same place they sent it the last
time. I can set the PrinterSetup.PrinterName, PrinterSetup.BinName,
PrinterSetup.PaperName before calling Print, but if the user changes the
print destination, it is not reflected in the TppReport.PrinterSetup after
printing. How can I determine where the user printed a report using the
standard PrintDialog?

Comments

  • edited February 2002
    I had a similar problem.
    It works for me if I have a BeforePrint event for the report, with a line
    something like
    theprinter:=ppreport1.printersetup.printername
    etc.
    The BeforePrint event appears to fire before printing but after the print
    dialog has gone away.
    Hope this helps
    Carl

  • edited February 2002
    Sorry, I almost forgot....
    There is a saveprintersetup property on the report as well.
    If set, any properties which the user changed will remain.
    It's under ppreport1.printersetup I think.
    Hope this helps
    Carl Davies


  • edited February 2002
    SavePrinterSetup is a published property on the Report. Should be able to
    set this and be good to go.


    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited March 2002
    I'm using several reports during a program session and my question is if
    it's possible to keep
    printer settings( such as paper type and print quality) during a program
    session.
    I also don't want to asociate those setting with a particular report( using
    SavePrinterSetup)
    or printer default setting.
    Ex: if decide to print on A4, best quality some report I'd like the next
    opened one to keep the same settings when printed.....

    Thanks in advance, Dan E.Mincu
  • edited March 2002
    You will need to access the changing PrinterSetup object and pull these
    values when the dialog is closed (Report.OnPrintDialogClose event). Then
    you'll need to configure the Report.PritnerSetup object when you go to print
    the next report. For example, to get the papername that hte user entered in
    the properties dialog of the print dialog:


    uses
    ppPrintr;

    procedure TForm1.ppReport1PrintDialogClose(Sender: TObject);
    var
    lsPaperName: String;
    begin
    lsPaperName :=
    TppPrinter(ppReport1.PrintDialog.Printer).PrinterSetup.PaperName;
    ...
    end;


    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited March 2002
    I have no problem in setting known parameters like # copies, or paper name,
    but how do I preserve
    specific driver settings like Printer Quality, Printer Resolution, Image
    Enhancements considering almost
    each printer have different custom settings. Word and ather programs does it
    by default and this is the
    expected behaviour in a program...
    Thanks,
    Dan E.Mincu

  • edited March 2002
    Currently, we do not support the ability to save the individual printer
    properties that can be configured for each printer. Thankyou, for the
    suggestion. I'll add it to the ToDo list.


    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.