-------------------------------------------------- Tech Tip: Windows Default Printer Settings ---------------------------------------------------
1. Default Printer Name
You can get the name of the computers default printer by accessing ReportBuilder's global printer list object - ppPrinters.
uses ppPrintr;
var lsPrinterName: String
begin
lsPrintername := ppPrinters.DefaultPrinterName;
end;
2. Default Printer Setup
Place the following code in the OnClick event-handler of a button on a form. When the button is pressed a message will be displayed showing the default printer name and paper size.
You can get the other document defaults via the TppPrinter.PrinterSetup properties.
Comments
Tech Tip: Windows Default Printer Settings
---------------------------------------------------
1. Default Printer Name
You can get the name of the computers default
printer by accessing ReportBuilder's global
printer list object - ppPrinters.
uses
ppPrintr;
var
lsPrinterName: String
begin
lsPrintername := ppPrinters.DefaultPrinterName;
end;
2. Default Printer Setup
Place the following code in the OnClick event-handler
of a button on a form. When the button is pressed
a message will be displayed showing the default
printer name and paper size.
You can get the other document defaults via
the TppPrinter.PrinterSetup properties.
uses
ppPrintr;
var
lPrinter: TppPrinter;
begin
lPrinter := TppPrinter.Create;
lPrinter.PrinterName := ppPrinters.DefaultPrinterName;
ShowMessage(ppPrinters.DefaultPrinterName + ': ' +
lPrinter.PrinterSetup.PaperName);
{assign default printer settings to a report}
myReport.PrinterSetup := lPrinter.PrinterSetup;
lPrinter.Free;
end;
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com