Subject Re: [IBO] Howto manually update control when detail dataset changes
Author lester@lsces.co.uk
> Just to make sure the problem is properly understood by everyone
> (else), I will try to describe once again. I am sorry to insist on
> this a bit, but my feeling is still that I either did not understand
> the data driven part or there is something missing in IBO.

No - I'm still not getting this

> I do have a working master-detail relationship in my application. For
> example, the master query is a list of all customers and the detail
> is a list of orders for each customer.

So when you change the master, the detail changes ?
Or do you have a master-detail where several 'masters' give
the same detail?

> A simple task is to simply display the detail set in the IBO grid, so
> there is one row for each order and one column for each field. This
> works fine and is well understood and documented.

OnDataChange will fire when the data changes - if the detail
does not change then the detail-OnDataChange does not fire

> What I want to do now is to display the detail dataset in a different
> form - no matter what exactly - say a crosstab.
>
> | Article1 | Article2 | Article3 |
> -----------------------------------------------
> Month1 | count | | |
> -----------------------------------------------
> Month2 | | | |
> ----------------------------------------------
>
> Another example would be to make a chart from the data in the detail
> dataset.
> I know, there is no SQL query that would give me the results in a way
> so I can just put them in a grid or chart control.
> I know, I have to write some piece of code to iterate through the
> whole detail dataset and put it into visualization.
> This is works fine and is well understood.

I update my TeeCharts in the OnDataChage of the Master - if
the WHERE for the TeeChart detail has been changed. I added
that to cut down a rebuild if not needed.

> My key issue is now: when do I have to call this code to update the
> visualization? Answer: each time the detail dataset does a requery.
> =================================================================
> The question is: how do I know when the detail dataset requeries?
> =================================================================

Answer - when the data that is controlling the query changes
- and you monitor that in the Master->OnDataChange - it
works for me for charts.

The Query I use for the chart is NOT linked as a detail, so
I can control when it gets updated. It may be that you are
getting bogged down with the automatic stuff ( Windows and
IBO ) when a simple slave query will provide the answer?

--
Lester Caine
-----------------------------
L.S.Caine Electronic Services