Home RAP

Dynamic PaperHeight

edited October 2002 in RAP
In order to get a receipt printer (continuous paper) to work I am trying the
following :

Create a pass-through function to retrieve the RecordCount of a TDBPipeline.
In the Report.BeforePrint set the Report.PrinterSetup.PaperHeight so that
everything fits on 1 page.

However, setting the PaperHeight based upon the RecordCount only works for
the second page, ie I first get a page of the normal size and then a one
page of the desired size.

The question is, how can I force RB to use the new PaperHeight in RAP ?

Comments

  • edited October 2002

    Due to timing, you need to set

    Report.Engine.Page.PrinterSetup.PaperHeight


    However, this property is not available to RAP. To set this property via RAP
    you will need to code a pass-through function that passes the Report object
    as a parameter. Something like SetPaperHeight(myReport, myHeight). See
    artcle below....


    --------------------------------------------------
    Article: Extending RAP
    ---------------------------------------------------

    There are two very simple and powerful techniques to extend the capabilities
    of RAP infinitely. These are summarized below and covered in more detail in
    the RAP.hlp online help. Demos and tutorials are installed to
    RBuilder\Demos\RAP. The tutorial text is located in RAP.hlp.


    1. RAP Pass-Through Functions

    These are functions that appear in the Language tab of RAP's Code Toolbox.
    These functions are written in Delphi and can be called from RAP. RAP's
    pass-through function architecture enable's developers to add new built-in
    functions to RAP's code toolbox.

    2. Extend RAP's RTTI

    RAP's Run-time Type information defines what classes and properties can be
    accessed via RAP. By default the published properties of any class that is
    registered with Delphi's RegisterClass procedure is recognized by RAP. In
    addition many of the public properties and methods of ReportBuilder classes
    are exposed.







    --
    Tech Support mailto:support@digital-metaphors.com
    Digital Metaphors http://www.digital-metaphors.com


    --
    Nard Moseley
    Digital Metaphors
    http://www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited July 2003
    > Due to timing, you need to set
    RAP
    object

    Hi,

    I tried this and it works. Now I will set the Left and top - porperty of an
    TppLine after changing the Paperheight in RAP with a pass-through
    function...

    In the Preview, the Line has the Left - Value as before changing the
    paperheight...

    How can I realign the TppLine in RAP after Changing the Paperheight?

    Regards,

    Hoffmann, Jan
  • edited July 2003
    In which event did you change the properties? Usually, set the TppPage
    object's properties in the Report.OnStartPage event and then the TppLine
    object's Top and Left should be set before the band gets to print so that it
    correctly generates the band. If it still doesn't work then send an small
    example with the pass through function included and we'll get it working.
    Keep in mind that when a report with RAP in it generates, it saves a copy of
    the template in memory so that after the repor runs, it can restore the
    template to ensure that the RAP code did not change the layout as it was
    designed, since RAP should only execute when the report prints.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited July 2003
    > In which event did you change the properties?

    I set the paperheight in the BeforePrint - event of the
    report. the left and top - property of the TppLine I set
    in the BeforePrint of the Detailband on which the TppLine
    is.

    Regards,

    Jan

    via
  • edited July 2003
    Interesting, that should work. Please send an example report to
    support@digital-metaphors.com and I'll take a look at what is causing the
    problem.


    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.