XlsExportOptionsEx.CalcTotalSummaryOnCompositeRange Property

Gets or sets whether a formula exported as total summary excludes cells with group summary values even if group summaries are calculated at runtime as custom summaries.Only available in data-aware export mode.

Namespace: DevExpress.XtraPrinting

Assembly: DevExpress.Printing.v21.1.Core.dll


public bool CalcTotalSummaryOnCompositeRange { get; set; }

Property Value

Type Description

True, if the total summary in the exported document is calculated against multiple cell ranges excluding cells with group summary values; otherwise, false.


Group summaries calculated in code as custom summaries are not recognized by total summary formulas when data are exported in XLS or XLSX format. Group summary cells are treated as data cells, resulting in incorrect totals. To fix the problem, set the CalcTotalSummaryOnCompositeRange property to true.

Consider a sample WinForms DataGrid project featuring a Grid View with group summaries and a total summary. Group summaries are calculated in code by handling the GridView.CustomSummaryCalculate event.

The total summary function in the exported XLS spreadsheet is dependent on the CalcTotalSummaryOnCompositeRange value, as illustrated in the following table.

CalcTotalSummaryOnCompositeRange = false CalcTotalSummaryOnCompositeRange = true
=SUBTOTAL(9,D3:D17) =SUBTOTAL(9,D3:D6,D9:D11,D14:D16)
The total summary is calculated against the entire column, including custom group summaries. It is incorrect. The total summary is calculated against the cell ranges with data, excluding custom group summaries. The result is correct.
See Also