AggFields property (TDataSet)

AggFields property (TDataSet)

Contains any aggregate fields.

Delphi syntax:

property AggFields: TFields;

C++ syntax:

__property TFields* AggFields = {read=FAggFields};

Description

Some TDataSet descendants, such as TClientDataSet, support aggregate fields. Aggregate fields summarize data over groups of records from the dataset (as opposed to calculated fields, which can only summarize data over the fields of a single record). AggFields is a collection of all aggregate fields that are supported by the dataset.

Note: The Fields property is a collection of all the dataset抯 fields that are not aggregate fields. Thus, AggFields and Fields are mutually exclusive collections of the dataset抯 fields. These two properties contain all of the dataset抯 fields between them.

 

Defining an aggregate field

An aggregate field displays values from a maintained aggregate in a client dataset. An aggregate is a calculation that summarizes the data in a set of records. See Using maintained aggregates for details about maintained aggregates.

To create an aggregate field in the New Field dialog box:

1 Enter a name for the aggregate field in the Name edit box. Do not enter the name of an existing field.
2 Choose aggregate data type for the field from the Type combo box.
3 Select Aggregate in the Field type radio group.
4 Choose OK. The newly defined aggregate field is automatically added to the client dataset and its Aggregates property is automatically updated to include the appropriate aggregate specification.

5 Place the calculation for the aggregate in the ExprText property of the newly created aggregate field. For more information about defining an aggregate, see Specifying aggregates.

Once a persistent TAggregateField is created, a TDBText control can be bound to the aggregate field. The TDBText control will then display the value of the aggregate field that is relevant to the current record of the underlying client data set.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值