How to: Change the PivotTable Layout
- 3 minutes to read
The table below describes the available report layouts and lists additional options that can be set for each layout form.
Additional Layout Options
This is the default layout for a newly created PivotTable report. This layout enables you to keep your report as narrow as possible.
It displays items from different row fields in a single column and subsidiary row field items are shown indented to the left.
This layout displays each row field in its own column. Subsidiary row field items begin one row below the parent field item.
This layout displays each row field in its own column. Subsidiary row field items begin on the same row.
Subtotals for items in the outer row fields are always shown at the bottom.
The following code example shows how to change the default PivotTable layout to outline form.
A complete sample project is available at https://github.com/DevExpress-Examples/wpf-spreadsheet-pivot-table-api-t314425.
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)