Back to Devexpress

XlsxExportOptionsEx.CalcTotalSummaryOnCompositeRange Property

corelibraries-devexpress-dot-xtraprinting-dot-xlsxexportoptionsex-e38d9dda.md

latest2.8 KB
Original Source

XlsxExportOptionsEx.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.v25.2.Core.dll

NuGet Package : DevExpress.Printing.Core

Declaration

csharp
public bool CalcTotalSummaryOnCompositeRange { get; set; }
vb
Public Property CalcTotalSummaryOnCompositeRange As Boolean

Property Value

TypeDescription
Boolean

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

|

Remarks

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 XLSX spreadsheet is dependent on the CalcTotalSummaryOnCompositeRange value, as illustrated in the following table.

CalcTotalSummaryOnCompositeRange = falseCalcTotalSummaryOnCompositeRange = 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

XlsxExportOptionsEx Class

XlsxExportOptionsEx Members

DevExpress.XtraPrinting Namespace