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

Report Templates into a database.

edited February 2002 in General
I wrote several reports that were saved as template files. The reports
are normally run from an application. I wrote a separate small
application that I would like to use to copy these templates to a
database using clientdatasets. I tried this using the ppreport and
datapipelines, but this method seems want to similar layout as to that
which was used to create or run the report from the application. I
used the "loadfromfile" method and the "savetodatabase" method. There
are times that it works ok, but other times events are being checked
that are not proper (available) when just trying save this file into a
database. For instance the name of the report component. My question
is how can I use the clientdataset to be used to load the template into
a blob field and save it into a database? I will then use the report
builder components to retrieve the report template ( I know how to do
this) from the database and print the report.

Comments

  • edited February 2002
    When you load a template, it is going to try to resolve the event handler
    references.

    The rtm is just a binary or ascii file. To see how we save it to a
    database, have a look in your RBuilder/Source/ppTmplat.pas in the procedure
    TppTemplate.SaveToSource

    Another approach my be to place the data access components on a TDatamodule.
    Then use it in your report forms. In the form, which has the event handlers
    for a template, load the templates and save them to the database. That way
    you won't have any problems when the template is loaded, and you can call
    Report.Template.SaveToDatabase.


    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.