EHLIB User Guide (Part Some)

zhaozj2021-02-16  47

EHLIB User Guide (Part Some)

Translation: nxyc_twz@163.com

5 use TDBSUMLIST components

TDBSUMLIST description

You can use TDBSUMLIST to record statistics in visual dynamic variation data. Set the relevant data fields in the data set you want to view, then write the sumlistChanged event to specify the operation you want to do after tdbsumlist changes. TDBSUMLIST's SUMCOLLECTION property lasts a TDBSUM object container. Each TDBSUM object is a component that can specify a collection value. FieldName and GroupOperation determine the type of collection value, and Sumvalue controls the current collection value.

TDBSUMLIST is buried in the DBGRIDEH component, so the following is the same as the description of TDBGRIDEH.SUMLIST with TDBGIRDEH's TDBGRIDEH.SUMLIST attribute is the same.

How to work and why do Sumlist's collection value is not correct?

You know the Data-Aware control and dataset are connected by TDATALINK objects. TDATALINK does not allow quick recalculation of set values. For example, when the record is deleted from the data set, the data set sends a DedatasetChange event to all TDATALINK objects, and the same event is also sent when the current local filtering changes. Therefore, when TDATALINK receives the event, it has to recalculate the set value in all data sets, even only from the data set to delete a record. After activation, TDBSUMLIST overloads the following events: ONAFTEREDIT, ONAFTERINSERT, ONAFTEROPEN, ONAFTERPOST, ONAFTERSCROLL, ONBEFOREDELETE, ONAFTERCLOSE. This approach avoids it in all data sets. Other problems will occur when there is no need, such as: Terraite specified these events. Turn off the Sumlist before specifying one of the above events. In the following case, Sumlist issues an error message. SUMLIST trials to return the event to the data set, but the data set data is not deleted. In this case, data is placed in different forms (data modules), and the data set is placed in this case. In this case, try to close the sumlist when the data set data is deleted from the data set or data module. If you use the setRange or ApplyRange event, Sumlist will not track changes in the data set. However, you can call the Sumlist.ReCalAll method. In the main / schedule of non-BDE datasets, Sumlist cannot track data changes. After the primary data set activation status data set changes, call the sumlist.reclalAll method. In any other case, if you find that other sumlist's calculated values ​​are incorrect, you can call the recalall method.

转载请注明原文地址:https://www.9cbs.com/read-26452.html

New Post(0)