How to get aggregate value in TVirtualTable?

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
99Percent
Posts: 48
Joined: Tue 13 Sep 2005 05:34

How to get aggregate value in TVirtualTable?

Post by 99Percent » Thu 08 Oct 2009 01:15

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?

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Mon 12 Oct 2009 08:00

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.

Post Reply