Subject Re: [IBO] Master Detail Structure with IBOQery
Author Helen Borrie
I wrote:
> > I like to create my datasets for QuickReport using TIB_Query objects, then
> > pass my data specs through to TIBOQuery objects using
> > AssignSQLWithSearch(). That's because I prefer to work with native
> > IBO.
At 11:02 AM 29-05-02 +0100, Carlos Macao wrote:

>I use ReportBuilder instead with TIBOQuery, would you mind to explain me
>your aproach with a little more detail?

Since I don't use RB, easier would be for you to try it out for yourself...

For my QuickRep, I have TIBO* queries for each datastructure I need for a
report. Whilst I'm designing the report, I have "stub sql" in these
queries - just sufficient to supply a data template that matches the
structure of the dataset which will be used in the real report, without any
selection criteria; or with some "typical" selection criteria.

These queries are hooked up to my IB_Connection via their Database
property. Often, I will give them their own transaction, too, since I
usually want tiConcurrency for reports, whereas the interactive work runs
in tiReadCommitted.

I'll then write a procedure that does any "business" required around the
native dataset, then assigns the latest dataset to the IBOQuery or
IBOQueries that are providing the data for the report, typically:

if Mode = 'Report' then
with ReportData do // ReportData is my IBOQuery
begin
if Active then Close;
if Prepared then Unprepare;
InternalDataset.AssignSQLWithSearch(IB_Query1);
Prepare;
Open;
end;
end;

After that, I just create the QuickRep object, run the report (Print,
Preview, etc.), destroy that and then (if needed) commit the transaction
and close the datasets.

At one time, before I had tried it, I thought it seemed very complicated to
do. As it turned out, it was not complicated at all - it works exactly as
I want it to. You can do just about anything you want with your visual
(native IBO-based) dataset and simply capture its latest SQL specs and pass
them over to your report.


regards,
Helen Borrie (TeamIBO Support)

** Please don't email your support questions privately **
Ask on the list and everyone benefits
Don't forget the IB Objects online FAQ - link from any page at
www.ibobjects.com