Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Help with print job settings please

edited October 2006 in General
We have a Xerox 5500 printer (with stapler), which is used to print
delivery documentation (usually hundreds of sheets) for deliveries from
a warehouse. Each sheet is printed twice and stapled together (to
simulate a carbon-copy).

In order to get this to work we have to use the Xerox Advanced option in
the print driver dialog to set copies=2 and collate=false (ie you can't
use the normal PrintSetup.Copies, that gives an entirely different
result!). Unfortunately this setting is lost each time a new print job
is started - the operator has to manually set the advanced options each
time (PrintSetup.SavePrinterSetup' is set to true).

This has now become an issue because we need to split each print run
into multiple jobs and cannot expect the operator to keep changing the
settings. The Advanced settings are lost even if the print dialog form
is not shown.

Yet, if you print from Word, for example, the Xerox driver does remember
its settings from one job to the next! It seems RB is clearing the Xerox
driver's settings when the job is initialised. So, what is the
difference between printing from Word, and printing from RB? Any
suggestions on how to fix this?

Any help would be much appreciated!



--- posted by geoForum on http://delphi.newswhat.com

Comments

  • edited October 2006
    Hi Brian,

    ReportBuilder uses simple generic Windows API commands to communicate with
    your printer. This means that RB only supports the standard printer
    features defined by the Windows API. There are however ways to access
    special functionality such as a stapler inside the DevMode structure. Take
    a look at the article below on how to access the DevMode. We do not have
    any examples of accessing these features however we have had customers in
    the past successfully implement them.

    One suggestion would be to try setting the PrinterSetup.DelegateCopies
    property to True and see if that makes any difference.


    -------------------------------------------------
    Tech Tip: Configuring Printer Specific Options
    -------------------------------------------------

    The Report.PrinterSetup properties can be used to set the properties that
    are common to all printers. Internally RB applies these to the Windows
    DevMode structure.


    Report.PrinterSetup <----> Windows DevMode <-----> Printer Driver <--->
    Printer


    Printers often contains additional features, such as output bins, media
    types, etc. The Windows DevMode structure can contain a private area that is
    used the printer driver to store printer specific options. These can be
    configured by using the Printer Driver's built-in properties dialog. These
    options can theoritically be set programmatically, the trick is that you
    have to know where in the structure to store the option and what values are
    valid.

    The following example shows how to display the printer properties dialog and
    save the devmode for use within RB...

    http://www.digital-metaphors.com/tips/SavePrinterDevMode.zip

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2006
    Nico,

    Thanks for the info, I have tried the example code but SetDevMode does
    not seem to change the printer setttings!

    I use the PrintDialogClose event to GetDevMode, print, then call
    SetDevMode before using PrintToDevices (all as per the example code),
    but even the basic settings from the dialog do not get applied to the
    second print.

    What am I doing wrong?

    Cheers,
    Brian

    in
    remember
    Xerox



    --- posted by geoForum on http://delphi.newswhat.com
  • edited October 2006
    Brian,

    The example is working as designed. If you change the DEVMODE setting in
    the driver printer dialog, it is changing the DEVMODE structure in the
    Windows API. This should be reflected when you print the report. Some
    printers will ignore these settings and process their own commands in their
    own way however the standard is to use the Windows API.

    Take a look at the example below. It is a good example of retrieving the
    DEVMODE structure, altering it, and setting it again.

    http://www.digital-metaphors.com/tips/PrintQuality.zip

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2006
    >The example is working as designed.

    Nico, here is the code in the example:

    ...
    lprinterdevice.printer.setdevmode(devmode);
    ppReport1.printtodevices;

    This does not work. However, it does work if, after the setdevmode, I
    insert:

    ppReport1.PrinterSetup:=lprinterDevice.printer.printersetup;

    This seems to commit the devmode to Windows.

    Maybe caused by a difference in versions? I'm using RB 9.0.

    I think that's my problem solved, the user still has to set the advanced
    properties, but at least I can remember and restore the setup
    automatically.

    Thanks again,
    Brian



    --- posted by geoForum on http://delphi.newswhat.com
This discussion has been closed.