Re: change default printer in Delphi


[ Delphi Forum ] [ Delphi Tutorials -- by DelphiLand ]

Posted by webmaster Guido on May 26, 2003 at 21:56:05:

In Reply to: change default printer posted by p12316 Gianni on May 25, 2003 at 07:42:21:

: How can i fix the printer choosen by 'PrintDialog' or 'PrinterSetupDialog' so than the next report uses it instead of default printer?

: something like
: ...
: printdialog1.execute;
: quickReport1.print;

: thanks
---------------

If you call the report's PrinterSetup method, this will set the printer settings for the report before you run it. You can do it like this:

with frmReport do
begin
  QuickRep1.PrinterSetup;
  QuickRep1.Preview;
end;

Or, if you want to print immediately, without preview:

with frmReport do
begin
  QuickRep1.PrinterSetup;
  QuickRep1.Print;
end;


[ Delphi Forum ]
[ DelphiLand: free Delphi source code, tips, tutorials ]