Skip to main content
Row

PivotFieldReferenceCollection.AddValuesReference() Method

Adds the virtual “Values” field to the row or column area of the pivot table.

Namespace: DevExpress.Spreadsheet

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

NuGet Package: DevExpress.Spreadsheet.Core

Declaration

PivotFieldReference AddValuesReference()

Returns

Type Description
PivotFieldReference

A PivotFieldReference object which represents the “Values” field.

Remarks

Use the AddValuesReference method to specify the position of the virtual “Values” field in a pivot table. The “Values” field automatically appears in a pivot table with more than one field in the data area, and is used to specify the orientation of multiple data fields in the report. By default, the “Values” field is added to the PivotTable.ColumnFields collection, so that multiple data fields are displayed across the columns, as shown in the image below.

PivotTable_ValuesField

To display the “Values” field as a row field in the report, use the AddValuesReference method of the PivotTable.RowFields collection. To add the “Values” field to the PivotTable’s row axis area or column axis area at the specified position, use the PivotFieldReferenceCollection.InsertValuesReference method. To change the “Values” field position within the area, use the MoveDown, MoveUp, MoveToBeginning or MoveToEnd method of the PivotFieldReference object representing the “Values” field in the report. To determine whether the specified PivotFieldReference is the “Values” field, use the PivotFieldReference.IsValuesReference property.

Note that you can also use the PivotLayout.DataOnRows property to specify the orientation of multiple data fields in a pivot table. To replace the default heading for the “Values” field, use the PivotViewOptions.DataCaption property.

See Also