FillDataSet

FillDataSet procedure

procedure FillDataSet(Const ADataSet: TDataSet; Const ASeries: TChartSeries; Const AGroupField, ALabelField, AValueField: String; Const GroupFormula: TGroupFormula);

Unit
TeeDBCrossTab

Description
Global method that can be called without having to use a DBCrossTabSource component.

The ADataset parameter means the original source dataset.
The ASeries parameter is the destination series that will be filled with crosstab results.
The AGroupField defines the field in the dataset to be used as the "grouping" field.
The ALabelField is the field in the dataset that will be used to add label text to series.
The AValueField is the field in the dataset that contains the values that will be acumulated when grouping.

The GroupFormula parameter specifies what to do with Values (sum them or count them).

Example:

FillDataSet( Table1, Series1, 'ShipVIA', 'CustNo', 'AmountPaid', gfSum );