PivotLayout.ShowAllSubtotals(Boolean) Method
Displays all subtotals in the PivotTable report.
Namespace: DevExpress.Spreadsheet
Assembly: DevExpress.Spreadsheet.v24.2.Core.dll
NuGet Package: DevExpress.Spreadsheet.Core
Declaration
Parameters
Name | Type | Description |
---|---|---|
topOfGroup | Boolean | true, to display subtotals for the outer row fields on top; otherwise, false. |
Remarks
By default, when you create a pivot table that contains multiple row and column fields, subtotals automatically appear for the outer fields. However, if subtotals have been turned off for the entire pivot table or its separate fields, you can display them again by using the ShowAllSubtotals method. The boolean parameter of this method allows you to specify the subtotal location for the outer row fields in compact or outline form: in particular, you can select whether to display subtotals at the top or bottom of each item in an outer row field. For row fields in tabular form, subtotals are always shown at the bottom.
If you wish to use a different function to calculate subtotals or to display more than one type of subtotals for a particular pivot field, use the field’s PivotField.SetSubtotal method.
To remove all subtotals from the report, use the PivotLayout.HideAllSubtotals method.
Example
Dim worksheet As Worksheet = workbook.Worksheets("Report1")
workbook.Worksheets.ActiveWorksheet = worksheet
' Access the pivot table by its name in the collection.
Dim pivotTable As PivotTable = worksheet.PivotTables("PivotTable1")
' Show all subtotals at the top of each group.
pivotTable.Layout.ShowAllSubtotals(True)
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the ShowAllSubtotals(Boolean) method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.