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

Printing on continuous paper

edited November 2004 in Devices
Hello.

I posted this question before and the answers I got never quite helped me
(though I thank all of you for the effort :).

I need to print a report on continuous paper (I dont know the length of the
page). I tried a couple of drivers and none of them offered me "Continuous
Paper" as of paper size.

Lets say I can calculate the total length of my report in RAP, is there any
way I can set the length of the report at runtime ?

I have to solve the problem ONLY within the bounds of a report, not in the
source of the application. I load a .rtm file at runtime and I can only
code in the Calc Tab of the report.

Can you see any other ways to solve my problem ? I really need to be able
to print this report.

Thanks

Steve

Comments

  • edited November 2004
    ----------------------------------------------------
    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;






    --


    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited November 2004
    Thanks for the fast response :)

    The report I made already uses the layout you suggest (with a small page
    height) but the printer I print on is equipped with a cutter and cuts the
    paper on every page break. I tried to set the printer to cut at the end of
    the job without success. I think my only chance is to have a report that is
    ALWAYS 1 page long.

    Any hint ?


  • edited November 2004

    You can set Report.PrinterSetup.PaperHeight prior to the report generating.
    You can try using Report.OnStartPage to set
    Report.Engine.Page.PrinterSetup.PaperHeight. That's about the last chance to
    set the paper size because the report engine relies upon that info to
    generate the report.


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



    Best regards,

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