Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TreeListXlExportOptions.CountBlankCellsInSummary Property

Specifies whether the Count summary function takes blank cells into account when exporting data in Excel formats.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[DefaultValue(false)]
public bool CountBlankCellsInSummary { get; set; }

#Property Value

Type Default Description
Boolean false

true to count non-blank and blank cells; false to count non-blank cells only.

#Remarks

The Count summary function in the source TreeList component calculates the number of data rows (regardless whether row values are empty).

When you export the summary to XLS or XLSX, the Count function in Excel calculates the number of non-blank cells only.

Set the CountBlankCellsInSummary property to true to take blank and non-blank cells into account in the resulting document.

Razor
<DxButton Text="Export to XLSX" Click="ExportXlsx_Click" />

<DxTreeList Data="TreeListData" KeyFieldName="Id" ParentKeyFieldName="ParentId" @ref="MyTreeList">
    <Columns>
        <DxTreeListDataColumn FieldName="Name" Caption="Task" />
        <DxTreeListDataColumn FieldName="EmployeeName" />
        <DxTreeListDataColumn FieldName="StartDate" />
        <DxTreeListDataColumn FieldName="DueDate" />
    </Columns>
</DxTreeList>

@code {
    ITreeList MyTreeList { get; set; }

    async Task ExportXlsx_Click() {
        await MyTreeList.ExportToXlsxAsync("ExportResult", new TreeListXlExportOptions() {
            CountBlankCellsInSummary = true
        });
    }
}
See Also