HotXLS Docs

SummaryFields property

Specifies the dataset field names whose columns receive SUM formulas in the totals row. Read-only TStrings; an empty list sums every exported numeric field

Remarks

The list contains 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 list is owned by the component: add and remove names through Add, Delete, and Clear, and do not 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');