Subject Re: [IBO] Calculated field to get SUM(SOME_FLOAT_FIELD)
Author Andreas Pohl
Try to use an inline select in your master query. It is much less traffic
then fetch all records.
Example for MasterQuery

select (select sum(mysumval) from t_detail d where d.masterid=m.id) as
sumval
, m.* from t_master m

In OnAfterPost event of detail query call MasterQuery.InvalidateRow; that
should update your sumval.

Mit freundlichem Gruss & Best Regards

Andreas Pohl
apohl@...
www.ibp-consult.com
----- Original Message -----
From: <hugosan@...>
To: <IBObjects@yahoogroups.com>
Sent: Monday, September 17, 2001 8:22 PM
Subject: [IBO] Calculated field to get SUM(SOME_FLOAT_FIELD)


> I have a Master-Detail relation, with an Order-Header and multiple
> Order-Item. The user makes the inserts in a Detail-Grid, and I use
> an Order-Item.CalculatedField to maintain and show the total amount
> by accumulating a global variable at OnCalcFields event.
> The problem is when there are more rows than the Grid can show: the
> other rows fire the OnCalcFields event only if the user requests them,
> and my total_amount is not real unlike the user scrolls all the grid
> up and down...
> Is there any way to force the Calculate for all the Dataset?
> Any other approach? I could make a Query for only SELECT SUM(..) FROM
> DETAIL, but I think that's too much traffic with the server.
> Thanks in advance,
> Hugo.
>
>
>
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>