Steema-BI-Samples icon indicating copy to clipboard operation
Steema-BI-Samples copied to clipboard

Delay-loaded TDataset import

Open davidberneda opened this issue 8 years ago • 0 comments

A boolean parameter in TBIDB Import method to not load all Dataset records, but just create and return a TDataItem filled with the structure of the Dataset (fields and subfields).

In this delayed mode, records will be loaded just-in-time when they are necessary (for example when calculating a query or presenting the TDataItem on a grid or chart).

This mechanism is already working when loading TDataItem from a binary file or stream (mydata.databi) so it should be easy to implement for both TDataSet and TConnection sources. The only issue here is the source dataset might be closed or destroyed before data has been loaded, in that case the TDataItem should not attempt to load data and just keep itself empty.

Refreshing the data items is also very easy, just call MyData.UnloadData and the internal delay-load flag will be reset, the data item will be emptied, and it'll load a new refreshed copy of the database data the next time is necessary

davidberneda avatar Jul 02 '16 21:07 davidberneda