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

variable paperheight?

edited August 2006 in General
I want to print to a point-of-sale printer and don't know the papger-height.
is there a way to set the paper height automatically?
when i set it to a value rb starts printing a new page. please help

thanks
christoph fritz

Comments

  • edited August 2006
    Hi Christoph,

    ----------------------------------------------------
    Article: Printing to Continuous Paper
    ----------------------------------------------------

    1. Layout

    For continuous printing (for example a receipt) use Title/Summary and
    removing the Header/Footer. Set the PrintHeight of each to phDynamic. Layout
    the DetailBand to print a single line item. Set the margins to 0 or to the
    smallest that the printer driver will support (some printers have an
    unprintable area).

    With this configuration The Report will generate a Title followed by a
    variable number of Detail bands that span pages if needed, and then finally
    print a Summary at the end.

    2. Pagination

    a. dtPrinter

    Some printer drivers have a continuous paper size setting. If not then try
    setting the paper size to be very small - perhaps the size of the tallest
    band in the layout. Or try setting the page height to be the size of a
    detail band. Note that some printer drivers will only accept page sizes
    within a certain range of paper sizes.

    b. dtReportTextFile

    With the above layout, the report text file will generate the page breaks
    properly, however the device will fill up a page with blank lines. You can
    control the number of lines per page by configuring the CharacterGrid
    property in the Report.BeforePrint event:

    example:


    procedure TForm1.ppReport1BeforePrint(Sender: TObject);
    var
    lDevice: TppReportTextFileDevice;
    begin

    if (ppReport1.FileDevice <> nil) and (ppReport1.FileDevice is
    TppReportTextFileDevice)then
    begin
    lDevice := TppReportTextFileDevice(ppReport1.FileDevice);

    {120 characters per line, 66 lines per page}
    lDevice.CharacterGrid(120, 66);
    end;

    end;

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited August 2006
    Nico Cizik (Digital Metaphors) wrote:

    Sorry, but that does not work here (RB 7.04, Delphi 5). In the preview, I
    get multiple pages. Or, if I set the page size too small, I get infinite
    pages. Can you suggest something?

    Ralf
  • edited August 2006
    Hi Ralf,

    Setting the page size to a small value ensures you do not use too much paper
    once the report has finished printing. This should not cause an infinite
    page report unless you have components outside the page bounds or your
    detail band is larger than the page height. Try printing directly to the
    printer without previewing. Do you get the same behavior as you do on
    screen?

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