Aggregated computed field in TClientDataset

Is it possible to add an aggregated field above the calculated field?

Suppose there are cds with the following fields:

  • identifier (auto increment)
  • Name (string)
  • Price (floating point)
  • Quantity (integer)
  • Total (integer) - calculated field - Price * Quantity

and I want to add agregate to get the sum of the Total column. Is it possible?

+6
source share
1 answer

Yes, it is possible if you change the calculated field to the InternalCalc field. The calculation is still performed in the OnCalcFields event, but you must check the status for InternalCalc when you do the calculation for this field.

+5
source

Source: https://habr.com/ru/post/915186/


All Articles