officefileapi-devexpress-dot-spreadsheet-dot-pivotlayout-dot-setreportlayout-x28-devexpress-dot-spreadsheet-dot-pivotreportlayout-x29.md
Applies the specified report layout to a pivot table.
Namespace : DevExpress.Spreadsheet
Assembly : DevExpress.Spreadsheet.v25.2.Core.dll
NuGet Package : DevExpress.Spreadsheet.Core
void SetReportLayout(
PivotReportLayout layout
)
Sub SetReportLayout(
layout As PivotReportLayout
)
| Name | Type | Description |
|---|---|---|
| layout | PivotReportLayout |
One of the PivotReportLayout enumeration members specifying the report layout.
|
Use the SetReportLayout method to change the layout of your PivotTable report to make it easier to read and understand. The available report layouts are listed below.
Compact layout (PivotReportLayout.Compact)
Outline layout (PivotReportLayout.Outline)
Tabular layout (PivotReportLayout.Tabular)
By default, the compact and outline layouts display subtotals for each item in the outer row fields at top. However, you can change the subtotal location and display subtotals below the subtotaled rows by using the PivotLayout.ShowAllSubtotals method with the false parameter. The tabular layout always displays subtotals for each item in the outer row fields at the bottom, irrespective of the value of the boolean parameter of the PivotLayout.ShowAllSubtotals method. If you wish to turn off the display of subtotals, call the PivotLayout.HideAllSubtotals method.
For the outline or tabular layout, you can also specify how to display item labels for the row and column fields. By default, items of the outermost column and row fields are displayed only once, while items in the remaining column and row fields are repeated as needed. If you wish to repeat item labels in all outer row and column fields, call the PivotLayout.RepeatAllItemLabels method. To repeat item labels in a particular field, use the PivotFieldLayout.RepeatItemLabels property.
Worksheet worksheet = workbook.Worksheets["Report1"];
workbook.Worksheets.ActiveWorksheet = worksheet;
// Access the pivot table by its name in the collection.
PivotTable pivotTable = worksheet.PivotTables["PivotTable1"];
// Display the pivot table in the outline form.
pivotTable.Layout.SetReportLayout(PivotReportLayout.Outline);
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")
' Display the pivot table in the outline form.
pivotTable.Layout.SetReportLayout(PivotReportLayout.Outline)
The following code snippets (auto-collected from DevExpress Examples) contain references to the SetReportLayout(PivotReportLayout) 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.
// Display the pivot table in the tabular form.
pivotTable.Layout.SetReportLayout(PivotReportLayout.Tabular);
// Merge and center cells with labels.
// Display the pivot table in the tabular form.
pivotTable.Layout.SetReportLayout(PivotReportLayout.Tabular);
// Merge and center cells with labels.
// Display the pivot table in the tabular form.
pivotTable.Layout.SetReportLayout(PivotReportLayout.Tabular);
// Merge and center cells with labels.
' Display the pivot table in the tabular form.
pivotTable.Layout.SetReportLayout(PivotReportLayout.Tabular)
' Merge and center cells with labels.
' Display the pivot table in the tabular form.
pivotTable.Layout.SetReportLayout(PivotReportLayout.Tabular)
' Merge and center cells with labels.
' Display the pivot table in the tabular form.
pivotTable.Layout.SetReportLayout(PivotReportLayout.Tabular)
' Merge and center cells with labels.
See Also