HotXLS Docs

SummaryFields property

Lists the dataset field names whose columns get SUM formulas in the totals row. Read-only TStrings; when the list is empty, every exported numeric field is summed

Remarks

The list holds source dataset field names, not export captions. A field named here is summed whether or not its data type is numeric; a name that is not exported is ignored. When the list is empty, the exporter sums the exported fields whose data type is one of the integer, large-integer, float, currency, BCD or BCD-with-format kinds. The component owns the list: add and remove names through Add, Delete and Clear, and never free the TStrings instance. The totals row is written only when SummaryRow is True

Syntax

property SummaryFields: TStrings read FSummaryFields;

Example

This example sums only the Quantity and Amount columns

DataToXLS1.SummaryRow := True;
DataToXLS1.SummaryFields.Clear;
DataToXLS1.SummaryFields.Add('Quantity');
DataToXLS1.SummaryFields.Add('Amount');