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

Where to send commands to printer?

edited October 2004 in General
I am working with an H-P 9065 printer with a stacker/stapler. I need to
send stacking and stapling commands to the printer. Sending the
commands is no problem. What I need to know is what event handler I can
use. I need an even handler(s) that fire after the printer document has
been started and before it has been ended. Which events qualify?

--
_Bill_

Comments

  • edited October 2004
    Hi Bill,

    Try using the TppReport.StartPage. If you are printing to the printer
    device, the OnStartPage event fires just after the page has sent to the
    printer but before it has finished printing.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2004
    TppReport.StartPage does not sound promising since any PCL code I send
    in this event will be at the end of the page and will not affect the
    page.

    Out of curiosity, why can I not put PCL codes in the Caption property
    of a ppLabel component and have them seen by the printer? That used to
    work great with DOS reporting tools. In Windows the PCL code is printed
    as text instead of being seen by the printer as an escape sequence.

    --
    _Bill_

  • edited October 2004
    Hi Bill,

    ReportBuilder strictly uses the Windows API to communicate with the printer
    driver, which in turn sends PCL codes to the printer. Ever since the
    introduction of Windows, the idea that a driver would take care of the
    printer commands based on what the API instructs has been the standard.
    This is how we can support so many different types of printers using
    virtually the same code. If you are trying to control a part of the printer
    that is not defined in the API, you will need to get access to the DEVMODE
    structure and try to understand the custom entries that the printer company
    has added so you can control the specific features. See the article below
    for more information.

    -------------------------------------------------
    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
This discussion has been closed.