Controls automatic calculation of aggregate values.
Use AggregatesActive to get / set the flag controlling automatic maintenance and calculation of dataset aggregate values.
When AggregatesActive is False (the default), the dataset does not maintain aggregates. This allows the dataset to perform large updates to the dataset or fetch big volumes of data without overhead of calculating aggregate values, which happens at fetching or data editing. When AggregatesActive is True, the dataset calculates and maintains all aggregate values specified by the Aggregates property that are compatible with the current index.
To selectively enable and disable aggregates rather than turning them all on or off at once, use the Active property of individual TADAggregate objects. These objects are available through the Aggregates property.
property AggregatesActive: Boolean;
var lPrevAggsActive: Boolean; ... lPrevAggsActive := ADQuery1.AggregatesActive; ADQuery1.AggregatesActive := False; try // perform updates here, without calculating and reading client aggregates finally ADQuery1.AggregatesActive := lPrevAggsActive; end;
What do you think about this topic? Send feedback!