Home Devices

Printer Tray Problem

edited June 2005 in Devices
Hi folks,

I'm having a problem printing to the correct tray. HP LaserJet 9000
Printer, Windows XP SP2, RB 9.02, Delphi 7

I have two reports. For each I initially have:
ShowPrintDialog := True
DeviceType := dtPrinter
SavePrinterSetup := True.

I call:
ppReport1.PrinterSetup.PrinterName := 'PrinterName' //selected from a drop
down.
ppReport2.PrinterSetup.PrinterName := 'PrinterName' //selected from a drop
down.
ppReport1.Print
ppReport2.Print

Naturally as expected the printer dialog comes up for each report showing
the chosen printer. For the first report the user selects Tray 3 and the
second report they select Tray 2 and both print out OK. The I want to print
out the report several more time in a loop but don't want to have the dialog
come up so I call:

ppReport1.ShowPrintDialog := false;
ppreport2.ShowPrintDialog := false;

begin loop
...
ppReport1.Print
ppReport2.Print
...
end loop


However, I get all the other reports coming out of Tray 3 when it should be
flipping between Tray 3 and 2.

Am I missing something? Is it the intended behaviour? Could there be a bug
somewhere?

Thanks,
Ara Mentcherian

Comments

  • edited June 2005
    Hi Ara,

    When calling Report.Print with the ShowPrintDialog property set to False,
    ReportBuilder will use the PrinterSetup defined when the report was created
    rather than the setup defined from the previous print job. Why not just use
    the copies feature? You can allow ReportBuilder to handle copies by default
    or let your printer handle them by setting the
    Report.PrinterSetup.DelegateCopies to True.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited June 2005
    Thanks Nico, that explains it. I can't use the copy since each iteration of
    the report contains different data.

    Now my bigger problem was that I was having problems printing to the correct
    trays on the HP 9000 by just using the reports PrinterSetup.BinName
    property. Tray 2 on the printer has Plain paper , Tray 3 has Color and they
    are setup that way on the printer. Even if I set the BinName to Tray 3 it
    will still print to Tray 2. In fact it will always print to the tray marked
    as Plain. However, if I show the Print dialog and the user selects the tray
    from there it will print to the correct tray. Now, this is a large batch
    job printing about 5000 pages with each loop mentioned below printing about
    10 pages. As you can guess, the user would not be very happy setting the
    print properties for each iteration.

    My guess is that this has something to do with the NT Forms settings but
    I've tried everything and can't seem to get the reports to print to the
    correct tray using just code. I've also tried the SetDevMode but it didn't
    work either. Any ideas would be appreciated.

    Thanks,
    Ara

  • edited June 2005
    Hi Ara,

    Be sure you are using the PrinterSetup.BinNames property to define the
    actual bin name you would like to use. This way you can be certain the
    correct bin name is being entered into the property. I believe by default,
    if the bin name is not recognized, the default bin in used.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.