DelphiFAQ Home Search:

QuickReports: PrinterIndex out of range

 

commentsThis article has not been rated yet. After reading, feel free to leave comments and rate it.

The solution for PrinterSetting in Quickreport is unfortunate. The workarounds, discussed in
newsgroups, didn't 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).

This is 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.

Comments:

 

 

Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option.
 
It seems that you are
from Los Angeles, US .

Info/ Feedback on this

Show city and country
Show country only
Hide my location
You can mark text as 'quoted' by putting [quote] .. [/quote] around it.
Please type in the code:
photo Add a picture:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity. The owner of this web site reserves the right to delete such material.