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

Force a new page from RAP

edited November 2003 in End User
Hi all

Is it possible to force a new page in a
SomeDetailBand.AfterPrint event?

I thought about something like

begin
Report.NewPage;
end;

BTW are all TppReport methods available to RAP?

Thanks in advance!
Bye
Nicola

Comments

  • edited December 2003

    See the article below on pagination.

    No all object methods are supported by RAP. But you can extend RAP
    infinitely. See second article below. (BTW the Tech Tips newsgroup is a good
    for technical articles such as those shown here).

    ---------------------------------------------
    Article: Forcing a Page Break
    ---------------------------------------------

    Question:

    How can I force a page break occur based upon
    a condition calculated at run-time.

    2 of the best solutions follow:

    Solution 1:

    Define a Group that starts on a new page when
    it breaks. Then use the Group.OnGetBreakValue
    event to control the timing of the break.

    1. From the Report Designer, select Report | Groups
    to access the Group dialog.

    2. Define a group based upon a static component,
    such as a Label or Variable. Click the
    Start new page checkbox. Close the dialog.

    3. Using the object inspector's drop down list,
    find and select the TppGroup object.

    4. Create an event-handler for the Group's
    OnGetBreakValue event.

    5. Add code to set the break value.


    procedure Form1.Group1OnGetBreakValue(Sender: TObject; var aBreakValue:
    String);
    begin

    if condition then
    aBreakValue := 'Some Value';

    end;


    Solution 2:

    1. Place a subreport at the point where you might want a page break.

    2. Remove its summary band and reduce the height of its detail and
    title bands to zero.

    By programmatically setting the title band's NewPage property you can
    conditionally force a page break. Note that everything after the
    subreport that is in the same band with it will need to
    ShiftRelativeTo the subreport.


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



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