Back to Devexpress

PivotLayout.HideAllSubtotals() Method

officefileapi-devexpress-dot-spreadsheet-dot-pivotlayout-cbb079a0.md

latest5.4 KB
Original Source

PivotLayout.HideAllSubtotals() Method

Hides all subtotals in the PivotTable report.

Namespace : DevExpress.Spreadsheet

Assembly : DevExpress.Spreadsheet.v25.2.Core.dll

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
void HideAllSubtotals()
vb
Sub HideAllSubtotals

Remarks

Use the HideAllSubtotals method to remove subtotals for all outer row and column fields in a PivotTable report.

csharp
Worksheet worksheet = workbook.Worksheets["Report1"];
workbook.Worksheets.ActiveWorksheet = worksheet;

// Access the pivot table by its name in the collection.
PivotTable pivotTable = worksheet.PivotTables["PivotTable1"];
// Show all subtotals at the bottom of each group.
pivotTable.Layout.ShowAllSubtotals(false);
vb
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 bottom of each group.
pivotTable.Layout.ShowAllSubtotals(False)

To remove subtotals for a particular outer field, call the field’s PivotField.SetSubtotal method and pass the PivotSubtotalFunctions.None value to it.

The following code snippets (auto-collected from DevExpress Examples) contain references to the HideAllSubtotals() 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.

wpf-spreadsheet-pivot-table-api-examples/CS/SpreadsheetWPFPivotTableExamples/CodeExamples/PivotTableLayoutActions.cs#L89

csharp
// Hide subtotals at the top of each group.
pivotTable.Layout.HideAllSubtotals();
#endregion #HideAllSubtotals

winforms-spreadsheet-pivot-table-api/CS/SpreadsheetPivotTableExamples/CodeExamples/PivotTableLayoutActions.cs#L89

csharp
// Hide subtotals at the top of each group.
pivotTable.Layout.HideAllSubtotals();
#endregion #HideAllSubtotals

spreadsheet-document-api-pivot-table-examples/CS/SpreadsheetDocServerPivotAPI/CodeExamples/PivotTableLayoutActions.cs#L103

csharp
// Hide subtotals at the top of each group.
pivotTable.Layout.HideAllSubtotals();
#endregion #HideAllSubtotals

wpf-spreadsheet-pivot-table-api-examples/VB/SpreadsheetWPFPivotTableExamples/CodeExamples/PivotTableLayoutActions.vb#L85

vb
' Hide subtotals at the top of each group.
            pivotTable.Layout.HideAllSubtotals()
' #End Region ' #HideAllSubtotals

winforms-spreadsheet-pivot-table-api/VB/SpreadsheetPivotTableExamples/CodeExamples/PivotTableLayoutActions.vb#L85

vb
' Hide subtotals at the top of each group.
            pivotTable.Layout.HideAllSubtotals()
' #End Region ' #HideAllSubtotals

spreadsheet-document-api-pivot-table-examples/VB/SpreadsheetDocServerPivotAPI/CodeExamples/PivotTableLayoutActions.vb#L94

vb
' Hide subtotals at the top of each group.
            pivotTable.Layout.HideAllSubtotals()
#End Region ' #HideAllSubtotals

See Also

PivotLayout Interface

PivotLayout Members

DevExpress.Spreadsheet Namespace