Home General

Tray names on different printer driver versions?

edited October 2016 in General
Hello,

we are printing a special report that prints some subreports to
different paper trays. For some of the subreports the trays are
containing special paper (such as labels).

In the report the trays are defined in the printer settings of the
subreprorts as "Tray 1", "Tray 2" and "Tray 3".

This works well when we use the same printer driver version on each system.

On some systems there are different printer drivers installed (same
version but other language) and the trays have different names there.
"Tray 1" is named "Magazin 1" in german, "Tray 2" is "Magazin 2".

When we print the report on such a system it seems that the printer
driver is not able to find the correct tray (due to its different name)
and it selects "Auto" and all subreports are printed to the same tray,
which is wrong for some subreports.

How can one handle such a situation (my only idea is to adjust the names
of the trays on the offending system...)

Thanks in advance,
Ralf

Comments

  • edited October 2016
    Hi Ralf,

    The PrinterSetup.BinNames returns the list of paper trays from the driver.

    You might check whether for the different language drivers, the BinNames are
    in the same order. Then you could use the same Index to set things up prior
    to printing the report. For example:

    const
    cTrayOne = 1;
    cTrayTwo = 2;

    myReport.PrinterSetup.BinName := myReport.PrinterSetup.BinNames[cTrayOne];




    Best regards,

    -
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited October 2016
    Am 20.10.2016 um 17:26 schrieb Nard Moseley (Digital Metaphors):


    Hi Nard,

    wouldn't it be better if the report stores not the bin name in the DFM
    but the index in the list?

    You will not always have the situation where the developer can handle
    this by code as you suggested. In some (most?) of the cases the end user
    will be in charge to maintain such setting because he knows where he
    wants to print (which printers are available)

    Ciao,
    Ralf
  • edited October 2016
    Hi Ralph,

    The Bin integer values vary by printer driver, there is no standard. The
    Windows API docs define constants for dmPaperSize, dmDefaultSource etc. See
    the link below. However, what you find in testing printer drivers is that
    they don't adhere to the standard. In real world testing what you find is
    that printer drivers are quite often poorly written and buggy. We have code
    to work around most bugs.

    https://msdn.microsoft.com/en-us/library/windows/desktop/dd183565(v=vs.85).aspx



    Best regards,

    -
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.