Back to Devexpress

PivotFieldReferenceCollection.InsertValuesReference(Int32) Method

officefileapi-devexpress-dot-spreadsheet-dot-pivotfieldreferencecollection-dot-insertvaluesreference-x28-system-dot-int32-x29.md

latest3.5 KB
Original Source

PivotFieldReferenceCollection.InsertValuesReference(Int32) Method

Inserts the virtual “Values” field into the collection at the specified index.

Namespace : DevExpress.Spreadsheet

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

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
PivotFieldReference InsertValuesReference(
    int index
)
vb
Function InsertValuesReference(
    index As Integer
) As PivotFieldReference

Parameters

NameTypeDescription
indexInt32

A zero-based integer which specifies the position at which the “Values” field should be inserted. If it is negative or exceeds the number of elements within the collection, an exception is raised.

|

Returns

TypeDescription
PivotFieldReference

A PivotFieldReference object which represents a reference to the inserted “Values” field.

|

Remarks

Use the InsertValuesReference method to add the virtual “Values” field to the PivotTable.ColumnFields or PivotTable.RowFields collection at the specified position. 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 end of the PivotTable.ColumnFields collection, so that multiple data fields are displayed across the columns, as shown in the image below.

You can also change the “Values” field’s position within the column or row area using the MoveDown , MoveUp , MoveToBeginning or MoveToEnd method of the PivotFieldReference object representing a reference to the “Values” field in the report. To determine whether the specified PivotFieldReference is the “Values” field, use the PivotFieldReference.IsValuesReference property.

See Also

AddValuesReference()

IsValuesReference

PivotFieldReferenceCollection Interface

PivotFieldReferenceCollection Members

DevExpress.Spreadsheet Namespace