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

skip labels for RTM reports

edited April 2005 in General
Hi!

I have tried your sample project for skipping labels, and it works fine
for a TppReport component.

We have more than 400 RTM files, so we can't access to DetailBand
OnBeforePrint event of those files.

How can we code that event for RTM files when loading them?

Thanks!

Comments

  • edited April 2005
    Hi Santy,

    If you would like to keep your event code local to the report template, you
    should check out RAP. RAP allows you to code your events in the "Calc" tab
    of the designer therefore making each template completely portable and able
    to run with any application that uses RB. See the following link for more
    information on RAP.

    http://www.digital-metaphors.com/Subpages/Products/Enterprise/Code.html

    It may be possible to assign a single event to a template that has already
    been loaded into a report object using the OnLoadEnd event. See the
    following article.

    ----------------------------------------------
    Tech Tip: Using Template Events
    ----------------------------------------------

    The Report.Template object has several events that can be used for
    customizing what happens when a report is loaded or saved:

    - OnLoadStart
    - OnLoadEnd
    - OnNew
    - OnSaveStart
    - OnSaveEnd


    The OnLoadEnd and OnNew events are often used to perform actions related to
    report and data initialization.

    The OnSaveEnd event is often used to save additional descriptive ("meta")
    data to the database each time the report is saved.

    Example:

    The Report.Template events are public and therefore must be assigned at
    run-time.


    1. In the private section of your form declaration you can declare an
    event-handler method:

    TForm = class(TForm)
    private
    procedure myTemplateOnLoadEndEvent(Sender: TObject);

    public

    end;


    2. In the Form.OnCreate event, you can assign the event-handler to the
    event:

    procedure TForm1.FormCreate(Sender: TObject);
    begin

    ppReport1.Template.OnLoadEnd := myTemplateOnLoadEndEvent;

    end;


    3. Implement the event-handler method:

    procedure TForm1.myTemplateOnLoadEndEvent(Sender: TObject);
    begin

    {add code here to initial the report or data, etc. }
    ppReport1.PrinterSetup.MarginTop := 0.5;

    end;


    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited April 2005
    Him Nico...

    Ok, I know that I can use template events to initialize templates at
    runtime, but the DetailBand.OnBeforePrint event of the template is not
    accessible at runtime.

    We can't use RAP, because we use RBuilder Pro.

    Isn't there another method to skip labels? Maybe with PipeLine
    OnTraversal, or OnPipeLineNext, etc...?

  • edited April 2005
    > Ok, I know that I can use template events to initialize templates at

    what do you mean? sure it is avaiable at run time.


    it sounds like you want the features of RAP--can you upgrade?


    you could configure the data prior to printing the report.

    Ed Dressel
    Team DM
This discussion has been closed.