EhLib
ContentsIndexHome
PreviousUpNext
TDBSumList Class

This component is to total record counts or field amounts in a TDataSet. The dynamic changes are visible at run time. The Component keeps a list of TDBSum objects, which contains a type of group operation (goSum, goAvg or goCount) and the name of the TDataSet field.

Pascal
TDBSumList = class(TComponent);

You can use TDBSumList for totaling records in a TDataSet with visible dynamic changes. Set the DataSet field in the dataset for which you want a watch, and write an SumListChanged event to take specific action after TDBSumList has changed. If you need a quicker method of recalculation, (for instance you can recalculate values in a separate query) you can write an OnRecalcAll event to do that and set ExternalRecalc = True. You can also write an OnRecalcAll event to initialize sum values. TDBSumList does not catch a changing in dataset after TTable.SetRange function (or ClientDataSet.SetRange). You need to call RecalcAll after SetRange for recalculate the sum.

Copyright (c) 1998-2013. All rights reserved.
What do you think about this topic? Send feedback!