Board index » delphi » Change printer setting in QReport does not work Please Help

Change printer setting in QReport does not work Please Help

Change printer setting in QReport does not work

I make differents reports with delphi 3 pro and I have 2 printers

when I make a QR preview all is well

but if I change the printer with the printer setting button or if I
change the settings of the current printer and then I click on the print
button, it print with the default printer and the default printer
settings.

How can I force QR to take care of the user printer settings?
Thanks for help

 

Re:Change printer setting in QReport does not work Please Help


Hi,
the solution for Printersetting in Quickreport is unfortunatly. The
workarounds, discussed in newsgroups did'nt work with windows NT
(Printerindex out of range: The Printer-Setup-Dialog seems to add
Printernames with a connectionstring. Perhaps, there is a problem in
Borlands Printers-Unit or in a corner of the Microsoft-jungle too).
Instead of discuss all this problems, I'll give a simple solution.
1. Add Unit Printers to your Form that controls Printing. Add an TCombobox
and name it "cbxPrinters"
2. In FormCreate add the following statement:
        cbxPrinters.Items.Assign(Printer.Printers);
3. The User has to choose the desired Printer with this Combobox.
4. Insert before the print-statement the following statement ("qrp" is the
name of the TQuickRep-Object)
        qrp.PrinterSettings.PrinterIndex:=cbxPrinters.ItemIndex;
5. REMARK: the quickreport-preview-printersetupdialog will not be affected.
Test it and instruct your users.

FAC <ral...@avo.net> schrieb im Beitrag <353DADF2.4...@avo.net>...

Quote
> Change printer setting in QReport does not work

> I make differents reports with delphi 3 pro and I have 2 printers

> when I make a QR preview all is well

> but if I change the printer with the printer setting button or if I
> change the settings of the current printer and then I click on the print
> button, it print with the default printer and the default printer
> settings.

> How can I force QR to take care of the user printer settings?
> Thanks for help

Other Threads