Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread OnFilterRecord caching
Tue, Nov 26 2013 7:31 PMPermanent Link

Peter Ingham

It appears that the results of calls to OnFilterRecord are being cached.

This causes problems when the conditions being evaluated by OnFilterRecord  are changed due to external factors.

Records that should have been excluded by the new conditions are returned; records that should now be included are excluded.  The OnFilterRecord routine is not being called.

A TDataset.Refresh does not cause the filter cache to be cleared.

At the moment, the only technique found that always works is to close and reopen then dataset which can be slow with complex queries, or turn DataSet.Filtered off and back on.

Is there some method or property setting that will result in OnFilterRecord being called the next time any record is considered for becoming active?
Tue, Nov 26 2013 9:37 PMPermanent Link

Raul

Team Elevate Team Elevate

On 11/26/2013 7:31 PM, Peter Ingham wrote:
> It appears that the results of calls to OnFilterRecord are being cached.
> This causes problems when the conditions being evaluated by OnFilterRecord  are changed due to external factors.

While i have not used this in a while i don't think you're supposed to
do it (change filter condition live).
Any change to filter condition required you to first set Filtered :=
false; change it and then set it back to True.


Also as per manual the callback for OnFilterRecord is un-optimized so
not really ideal for large data sets. The suggestion in manual is to
first set a range to reduce the dataset size

http://www.elevatesoft.com/manual?action=viewtopic&id=dbisam4&product=rsdelphiwin32&version=XE2&topic=Setting_Filters_Tables_Query

Raul
Wed, Nov 27 2013 10:56 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Peter,

<< It appears that the results of calls to OnFilterRecord are being cached.

This causes problems when the conditions being evaluated by OnFilterRecord
are changed due to external factors.

Records that should have been excluded by the new conditions are returned;
records that should now be included are excluded.  The OnFilterRecord
routine is not being called.

A TDataset.Refresh does not cause the filter cache to be cleared. >>

Yes, a Refresh won't work unless the underlying data has been changed.  The
only way to do so is what Raul suggests - toggle the Filtered property.

Just so you know, our newer product, ElevateDB, handles this in the manner
that you expect - incrementally and dynamically filtering the records.

Tim Young
Elevate Software
www.elevatesoft.com


Image