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

Question about saving and loading report templates

edited September 2002 in End User
Delphi 6.2 RB 7.0 Pro

When a report is saved to a rtm file, does it save all objects in the form
, like the DBPipeline,
the TDataSet and the TQuery or it saves only the report layout ?

I read on the users guide that the tecnology is the same used by Delphi to
save the dfm therefore
it makes sense to ask this question.

My problem is that I created a very simple report and saved it as a rtm
file.
When I load the template from inside this form, ( Using the File\Open ) it
works fine but if I load it via my application, it shows a report without
any data on it

I'm not using the Report Explorer , DADE, etc... I still need to learn all
that.

All I want to do is to be able to have a list box where the end user can
choose a report, then load the related template and run it.. And, of course,
to have the flexibility to send new templates at random and have then
available to the user

I'm running out of time to delivery the application to my client, therefore
any help would be
very much appreciated.

I use RB standard since 3.0 but only now I upgrade to 7.0 Pro. The way I've
been doing is
using DLL's to send different reports to different users but I really liked
the concept of
templates.

Comments

  • edited September 2002
    The reason you aren't seeing any data is that the report is not connecting
    itself up to the datapipeline that it was assigned to on the form when it
    was saved to the rtm file. There is an article describing lost event
    handlers which is related to this. This article, and others, can be found in
    our Tech-Tip newsgroup in the Templates thread. Please read through these
    first.

    The template is going to save the published properties that are assigned to
    the objects on the form. When you load the template, the datapipeline can't
    be found on the form. You can hook it up at runtime in the public
    Report.Template.OnLoadEnd event. If you decide to use templates, it is
    going to make life easier if you use DADE (to store the entire data access
    definition inside of the template) and RAP (to store all of the event
    handlers and calculations for the report inside of the template so that you
    aren't tied down to Delphi event handlers). Previously, you were working
    around this by using dlls. Well, with report templates using DADE and RAP,
    you can send a new templates with an updated data access configuration in
    DADE (using the same data settings to find the data) and also new
    calculations in RAP. The cool thing about this approach is that you don't
    have to redistrbute a new exe or dll, you only have to distribute the new
    rtm file.


    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.