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

Saving and Restoring TdaSQL

edited November 2002 in DADE
Hello,

I am not certain which newsgroup is most appropriate for my question, so
please suggest an alternative if there somewhere more appropriate to place
this question.

We are using ReportBuilder 6.03 in Delphi 6 as follows:

We instantiate a TdaQueryWizardDialog object on its own (we just want to use
QueryWizard to build a query), then save the created raw SQL and use it
elsewhere in the application.

What we would like to be able to do, is to somehow save the TdaSQL object
that contains the information on our Query in our database, then retrieve it
at a later time and assign it to a new instance of TdaQueryWizardDialog , in
order to allow the query to be updated.

We were considering possible ways to do this along the lines of:

Finding an object O that contains both TdaSQL and TppReportTemplate.

Putting ours TdaSQL from the QueryWizard in that object.

Using the Template.SaveToDatabase method to save it

Then retrieving it later by creating an instance of the object O, using the
Template.LoadFromDatabase method to get out the desired saved object, and
getting the TdaSQL object from O.

The difficulty we have encountered is in finding an object O that fits the
description. We attempted using a TppReport, but can't find a way to put
the TdaSQL from our QueryWizard into the TppReport.

So, we are hoping that someone else might have done something like this and
could provide some suggestions as to whether this is possible, what object
to use, or if there is some easier way to save and restore a TdaSQL object
using a Database.

Thanks!

Deva Fagan
~~~~~~~~~~~~~~~~~~
dfagan@tickets.com

Comments

  • edited November 2002
    TdaSQL is a descendent of TPersistent. You can use Delphi streaming to save
    down the object just as we do in our report template. Take a look in
    ppTmplat.pas to see where we stream the report objects down to a file or
    database. Start with the code in the SaveToSource method.


    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.