Skip to main content
Row

PivotLayout.DataOnRows Property

Gets or sets a value indicating whether multiple data fields in a pivot table should be displayed in rows down the report.

Namespace: DevExpress.Spreadsheet

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

NuGet Package: DevExpress.Spreadsheet.Core

Declaration

bool DataOnRows { get; set; }

Property Value

Type Description
Boolean

true, to arrange multiple data fields as a row field; otherwise, false.

The default value is false.

Remarks

Use the DataOnRows property to specify the orientation of multiple data fields in a pivot table. By default, when you add two or more fields to the data area, they are displayed horizontally across the columns, as shown in the image below.

SpreadsheetPivotTable_DataOnRows_False

If the DataOnRows is set to true, multiple data fields are displayed vertically as the innermost row field.

SpreadsheetPivotTable_DataOnRows_True

To replace the default “Values” heading for multiple data fields, use the PivotViewOptions.DataCaption property.

Example

The example below demonstrates how to change the orientation of multiple data fields in a pivot table to display them going across columns. To do this, use the PivotLayout.DataOnRows property of the PivotTable layout object that is accessed from the PivotTable.Layout property.

View Example

Dim worksheet As Worksheet = workbook.Worksheets("Report2")
workbook.Worksheets.ActiveWorksheet = worksheet

' Access the pivot table by its name in the collection.
Dim pivotTable As PivotTable = worksheet.PivotTables("PivotTable1")
' Display value fields in separate columns.
pivotTable.Layout.DataOnRows = False

The following code snippets (auto-collected from DevExpress Examples) contain references to the DataOnRows property.

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.

See Also