Home RAP

PaperHeight

edited January 2008 in RAP
Happy new year!

In a report i need to calculate the paperheight of the output according to
how many records there are in the pipeline. In which event should i perfom
this calculation, and how can get to now the number of records in a
pipeline?

I use D2007, RB 10.x and the calculation is to be within the report.

Best regards,
Terje Syversen

Comments

  • edited January 2008
    Hi Terje,

    What are you trying to ultimately accomplish? Determining the record count
    prior to the report generating is very difficult if you do not have access
    to the original dataset, especially if you plan to alter the spacing of the
    report in any way. Perhaps give a bit more information on what you are
    trying to do and I can find a solution for you.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited January 2008
    Hi Nico,

    This is for printing to a receipt - printer (Epson TM II). I need to
    calculate the PaperHeight according to how many lines there will be in the
    detail, something like "Report.PrinterSetup.PaperHeight := 80+(4.5 *
    RecordCount)". After the print i will send a "CutPaper" command to the
    printer.

    Best regards,
    Terje



  • edited January 2008
    Hi Terje,

    One option would be to separate your report into groups and send the cut
    command in a group event. Take a look at the following article on printing
    to continuous paper for help with the paper size.

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