Subject | Re: [IBO] Re: Calculated field column total? |
---|---|
Author | Paul Hope |
Post date | 2002-02-28T10:18:53Z |
Thanks for the replies.
I have implemented a working solution like part 2 of Marcos reply - calling
the CalculateTheSum procedure in code after refresh etc.
Works fine but it would be much neater if there was an event to attach it
to.
Regards
Paul
""mmenaz"" <mmenaz@...> wrote in message
news:a5jq1l+q79p@......
changed by this app, put the code in lines following the Invalidate;
Refresh; code, or wherever/however you refresh your dataset.
I have implemented a working solution like part 2 of Marcos reply - calling
the CalculateTheSum procedure in code after refresh etc.
Works fine but it would be much neater if there was an event to attach it
to.
Regards
Paul
""mmenaz"" <mmenaz@...> wrote in message
news:a5jq1l+q79p@......
> I don't understand your setup, sice in one place you state that is a readonly dataset, in another you are talking about "row changes"...
> Anyway, if the changes are made by others, and you are just displayingrows, I suggest a IB_Cursor or a IB_DSQL with a sum(xx).
> If you are changing row values in the dataset displayed with the grid,calculate values in the buffer in the IB_Datasource.DataChange event. If not
changed by this app, put the code in lines following the Invalidate;
Refresh; code, or wherever/however you refresh your dataset.
> Just some (confused?) ideas ;)asking it
> Regards
> Marco Menardi
>
> --- In IBObjects@y..., "Paul Hope" <paulhope@a...> wrote:
> > Hi
> >
> > I want to display a total of a calculated field for a read only dataset
> > displayed in a grid. I could fire off another query on the server
> > to recalculate a total every time a row changes in the displayeddataset -
> > but this seems very inefficient.doesn't
> >
> > What I was hoping to do is in CalculateField
> > subtract ARow.ByName('MyCalculatedField').asCurrency from my total
> > calculate the new value of MyCalculatedField
> > add the new value to my total
> >
> > Unfortunately reading the calculated field value before it is set
> > work. It seems to return the value it had calculated for the previousrow.
> >___________________________________________________________________________
> > I have also tried summing the field values in the buffer (having set
> > Fetchall to true) but I havn't found an appropriate event to attach this
> > to - 'AfterRefresh' would be nice.
> >
> > Any Ideas?
> >
> > Regards
> > Paul
>
>
>
>
> IB Objects - direct, complete, custom connectivity to Firebird orInterBase
> without the need for BDE, ODBC or any other layer.___________________________________________________________________________
>
> http://www.ibobjects.com - your IBO community resource for Tech Infopapers,
> keyword-searchable FAQ, community code contributions and more !
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>