The requested page is not available for the requested platform. You are viewing the content for .NET Framework 4.5.2+ platform.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
Row

PivotPageField Interface

Represents a reference to a PivotField object that is currently shown as a page field.

Namespace: DevExpress.Spreadsheet

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

Declaration

public interface PivotPageField :
    PivotFieldReferenceBase
Public Interface PivotPageField
    Inherits PivotFieldReferenceBase
public interface PivotPageField :
    PivotFieldReferenceBase
Public Interface PivotPageField
    Inherits PivotFieldReferenceBase

Remarks

The PivotPageField object is a member of the PivotPageFieldCollection collection, which stores all page fields of a PivotTable report. An individual PivotPageField object can be accessed by its name or index in the collection using the PivotPageFieldCollection.Item property.

To add a PivotField to the PivotTable's report filter area, use the PivotPageFieldCollection.Add method.

Dim sourceWorksheet As Worksheet = workbook.Worksheets("Data1")
Dim worksheet As Worksheet = workbook.Worksheets.Add()
workbook.Worksheets.ActiveWorksheet = worksheet

' Create a pivot table.
Dim pivotTable As PivotTable = worksheet.PivotTables.Add(sourceWorksheet("A1:D41"), worksheet("B2"))

' Add the "Product" field to the row axis area.
pivotTable.RowFields.Add(pivotTable.Fields("Product"))
' Add the "Category" field to the column axis area.
pivotTable.ColumnFields.Add(pivotTable.Fields("Category"))
' Add the "Sales" field to the data area and specify the custom field name.
Dim dataField As PivotDataField = pivotTable.DataFields.Add(pivotTable.Fields("Sales"), "Sales(Sum)")
' Specify the number format for the "Sales" field.
dataField.NumberFormat = "_([$$-409]* #,##0.00_);_([$$-409]* (#,##0.00);_([$$-409]* "" - ""??_);_(@_)"
' Add the "Region" field to the filter area.
pivotTable.PageFields.Add(pivotTable.Fields("Region"))

To re-order fields in the report filter area, use the PivotFieldReferenceBase.MoveDown, PivotFieldReferenceBase.MoveUp, PivotFieldReferenceBase.MoveToBeginning or PivotFieldReferenceBase.MoveToEnd method of the PivotPageField object whose position you wish to change.

To remove a page field from the pivot table, use the PivotPageFieldCollection.Remove or PivotPageFieldCollection.RemoveAt method.

See Also