Page 1 of 1

How to get aggregate value in TVirtualTable?

Posted: Thu 08 Oct 2009 01:15
by 99Percent
I tried adding a TAggregateField in a vt dataset and it wasn't allowed (invalid FieldKind error).

I have tried going through all the records in OnCalcFields event but it goes through infinite recursion even if I set AutoCalcFields:=false and use an external variable.

I tried to assign the dataset to a clientdataset, but it wasn't allowed either.

What to do?

Posted: Mon 12 Oct 2009 08:00
by Plash
You can calculate an aggregate value after opening VirtualTable. Save this value into a variable, and use it as you want. You can recalculate the value in the AfterPost and AfterDelete events.