How do I get the record count and record number when a TwwDBGrid is filtered?
I am using TAQOQuery.
-
I ended up using the OnAfterMenuFilter to create a "footer SQL query", using TwwFieldInfo items, that sums all the BCD (money) fields in the dataset to update the TwwDBGrid Footer.
This was a bit tricky since the existing SQL query had JOIN's and the filtered fields provided could be based on a field from a JOIN so I had to provide SUM(tablename.[field]) in both the SELECT and WHERE areas of the new query while keeping the FROM and JOINS intact.
Once that was done, I created a similar simple (just the field name) "where clause" to set the filter on the dataset which provided access to the true RecNo and RecordCount.
It was pretty involved but is quick and accurate.
Please sign in to leave a comment.
Comments
2 comments