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

Re: RTM's and DLL's

edited November 2003 in General
Hello.

What I would like to do is create a dll with .rtm files in it. Then call the
dll and load the reports into the database using the method below:

ppreport1.Template.FileName := FileListFileName.Strings[i];
ppreport1.Template.LoadFromFile(ReportDLL, Report.rtm);
ppreport1.Template.DatabaseSettings.Name := FileListDBName.Strings[i];
ppReport1.Template.SaveToDatabase;

Could someone give me a hint as to how this would work?

Many thanks in advance!
Tim Armstrong

Comments

  • edited November 2003
    Hi Tim,

    There is no built in way to add and extract report template files to a .dll
    file. One approach would be to save your template filest in ASCII format
    and then save them as a string in a resourse file (.res). Then you can
    compile these resource files in with your .dll project, later extracting
    them and saving the strings as Blob fields in your database.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited November 2003
    How would I do using reportexplorer or some other ReportBuilder method?

  • edited November 2003
    The following is what I tried next but it was blowing up because the events
    that are attached to the report are not present.

    ppreport2.Template.DatabaseSettings.Name := FileListDBName.Strings[i];
    ppreport2.Template.LoadFromDatabase;
    ppreport1 := ppreport2;
    ppreport1.Template.DatabaseSettings.Name := FileListDBName.Strings[i];
    ppreport1.Template.SaveToDatabase;

  • edited November 2003
    Hi Tim,

    If a report template has event handlers connected to it and you load it to a
    report object without these event handlers defined, you will run into some
    issues. You then have two choices.

    1. Be sure all event handlers present when the report template was created
    are present in the current application you load the report to. (They must
    be named the same as well).

    2..Use RAP to store all your event handler code locally inside each report
    template. RAP (Report Application Pascal) is available with ReportBuilder
    Enterprise Edition and allows you to keep all event handler code, as well as
    other report code inside the report template so each report can execute
    independently of a specific applicaiton. For more information on RAP, check
    out our web site and/or try downloading a trial version of ReportBuilder
    Enterprise.

    --
    Best Regards,

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