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

Calcs not saved

edited March 2003 in End User
Hi.
I just bought ReportBuilder 7.02. Delphi 6 Pro (all updates), Win XP Pro.
I have two questions:

1) Why, when I save a report that has calculations in it to a rtm file and
then load it into the user report application, when I run it from the user
application, it does not perform the calculations?

2) When I remove the TeeCharts from the end-user designer using the object
inspector by setting the switch to false, the DBChart does not go away from
the end-user designer?

Thanks.
pl

Comments

  • edited March 2003
    Paul,

    1. The article below explains why you may be loosing your calculations.

    2. Do a search for TeeChart on your project. If you do not have any of the
    TeeChart include files in your 'uses' clause such as ppChrt, ppChrtDP, or
    ppTeeChart.


    --------------------------------------------
    Article: Troubleshooting Lost Event Handlers
    --------------------------------------------

    Let's assume you have created a report in Delphi and assign an event
    handlers to the OnPreviewFormCreate event of the report. The event is
    generated by Delphi as:

    procedure TForm1.ppReport1PreviewFormCreate(Sender: TObject);

    You then save the report to an RTM file 'Report1.RTM.' The events are
    stored as references only, and so the RTM contains:

    object ppReport1: TppReport
    .
    .
    OnPreviewFormCreate = ppReport1PreviewFormCreate
    end

    You then go on to work on a different report. Saving it with under then
    name 'Report2.RTM'. Only this time, before you save the report you
    change the report component name to: rptOrders. Delphi automatically
    updates the event declaration for OnPreviewFormCreate event to:

    procedure TForm1.rptOrdersPreviewFormCreate(Sender: TObject);


    You then create two buttons on the form, one to load Report1 and
    preview, the other to load Report2 and preview. When you run the app
    and click Report1, you an error. This is because the Report1.RTM file
    contains a reference to ppReport1PreviewFormCreate, a method which no
    longer exists (at least with this name) in the form.

    One answer is to load all your rtm files into the report component you
    will be using for loading. Fix any errors, reassign any events that get
    cleared. This will update your rtms to contain the proper event handler
    names.


    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited March 2003
    Hi Nico,
    Thanks for your response.
    That is not what is happening. What is happening is this.
    I create a report in a project. I then save the report to a RTM file.
    Then, using the end-user Report Explorer, I create a new report and then I
    load that RTM file into the new report. When you preview that report in the
    Report Explorer, the calcs are no longer working.
    My question is this. When you save a report as a rtm, does it save the
    compiled code or just a template of the report without the binary, hence no
    calcs or coding?

    Thanks.
    pl

  • edited March 2003
    Paul,

    When you save a .rtm file, you are saving the details of your report along
    with references to any events you have defined in Delphi code, not the
    actual Delphi code. If you then load the .rtm file into a report located in
    a different unit, then the event handler will not be reassigned all the
    event code will never fire. You don't mention which version of RB that you
    are using. The best solution to this problem would be to upgrade/utilize to
    ReportBuilder 7.02 Enterprise Edition. ReportBuilder Enterprise Edition
    includes Report Application Pascal. Report Application Pascal (RAP) is
    ReportBuidler's run-time Pascal development environment. Enterprise enables
    the entire report definition (Data, Calculations, and Layout) to be stored
    outside of the application executable. Using RAP, developers and end-users
    can code calculations and event-handlers without Delphi. RAP is
    extensible - which means developers can easily register their own built-in
    functions and objects to meet specific requirements.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.