PrintToDevices and PrinterSetup.Copies
I am using the PrintToDevices method because I have my only print dialog box
which allows the user to modify the report and printer settings. I use the
code below, which I think originally came from the tech-tips. The problem is
that no matter what I set the value of Report1.PrinterSetup.Copies to, it
only ever prints 1 copy (note: the property Report1.PrinterSetup.Collation
is set to True). If I use the print method then I get the right number of
copies.
var
aDevMode: THandle;
lPrinterDevice: TppPrinterDevice;
begin
Report1.Printer.GetDevMode(aDevMode);
lPrinterDevice := TppPrinterDevice.Create(nil);
lPrinterDevice.Publisher := Report1.Publisher;
lPrinterDevice.Printer.SetDevMode(aDevMode);
Report1.PrintToDevices;
lPrinterDevice.Free;
end;
which allows the user to modify the report and printer settings. I use the
code below, which I think originally came from the tech-tips. The problem is
that no matter what I set the value of Report1.PrinterSetup.Copies to, it
only ever prints 1 copy (note: the property Report1.PrinterSetup.Collation
is set to True). If I use the print method then I get the right number of
copies.
var
aDevMode: THandle;
lPrinterDevice: TppPrinterDevice;
begin
Report1.Printer.GetDevMode(aDevMode);
lPrinterDevice := TppPrinterDevice.Create(nil);
lPrinterDevice.Publisher := Report1.Publisher;
lPrinterDevice.Printer.SetDevMode(aDevMode);
Report1.PrintToDevices;
lPrinterDevice.Free;
end;
This discussion has been closed.
Comments
following line of code in before I call PrintToDevices :
lPrinterDevice.Printer.PrinterSetup.Copies := Report1.PrinterSetup.Copies;