Retaining Printer Properties set by user
Hi
I have an invoice printing routine which loops through a batch of invoices
and changes the .rtm to the correct template for the invoice before using
Template.LoadFromFile and printing the invoice.
I display the Print Dialog on the first invoice and then supress it for
subsequent invoices using the following code:-
if j > 0 then
begin
ppViewer1.Report.ShowPrintDialog := FALSE;
PrinterSetup.PrinterName := MyPrinter;
PrinterSetup.Copies := MyCopies;
end;
This works very well except for when the user changes the printer properties
from the default i.e. selects Greyscale insted of Colour.
The first invoice prints in greyscale but then all subsequent invoices print
in colour.
Can you please advise how I would retain all the values set by the user for
this print run.
Thanks in advance
Philip L Jackson
By the way everyone really likes the new alignment features of 11.xx
I have an invoice printing routine which loops through a batch of invoices
and changes the .rtm to the correct template for the invoice before using
Template.LoadFromFile and printing the invoice.
I display the Print Dialog on the first invoice and then supress it for
subsequent invoices using the following code:-
if j > 0 then
begin
ppViewer1.Report.ShowPrintDialog := FALSE;
PrinterSetup.PrinterName := MyPrinter;
PrinterSetup.Copies := MyCopies;
end;
This works very well except for when the user changes the printer properties
from the default i.e. selects Greyscale insted of Colour.
The first invoice prints in greyscale but then all subsequent invoices print
in colour.
Can you please advise how I would retain all the values set by the user for
this print run.
Thanks in advance
Philip L Jackson
By the way everyone really likes the new alignment features of 11.xx
This discussion has been closed.
Comments
RB 11 has a new PrinterSetup.DeviceSettings property that contains the
complete printer setup DevMod structure - which includes all custom
settings/features that the printer supports. There are also new methods for
saving DeviceSettings to file and stream.
Try creating a memory stream and using
PrinterSetup.SaveDeviceSettingsToStream and LoadDeviceSettingsFromStream.
uses
ppPrintr;
// show printer dialog
// save device settings
PrinterSetup.SaveDeviceSettingsToStream (myMemStream);
// then for the other reports
myMemStream.Position := 0;
PrinterSetup.LoadDeviceSettingsFromStream(myMemStream);
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Works very well.
Regards
Philip L Jackson