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

PivotFilter Interface

Represents a filter applied to a PivotTable field.

Namespace: DevExpress.Spreadsheet

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

Declaration

public interface PivotFilter
Public Interface PivotFilter
public interface PivotFilter
Public Interface PivotFilter

Remarks

The PivotFilter objects are stored in the PivotFilterCollection collection, which can be accessed using the PivotTable.Filters property.

To create a new filter and apply it to a specific row or column field in the pivot table, use the PivotFilterCollection.Add method overloads. Different types of filters are available: you can construct the filter expression to display items that meet the specified criteria (Label Filters and Date Filters), or filter report data based on calculated values (Value Filters).

The example below demonstrates how to apply a label filter to the "Region" field to display sales data only for the Southern region.

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

' Access the pivot table by its name in the collection.
Dim pivotTable As PivotTable = worksheet.PivotTables("PivotTable1")
' Access the "Region" field.
Dim field As PivotField = pivotTable.Fields(0)
' Filter the "Region" field by text to display sales data for the "South" region.  
pivotTable.Filters.Add(field, PivotFilterType.CaptionEqual, "South")

To remove a specific filter, you can either use the filter's PivotFilter.Delete method or the Remove/RemoveAt methods of the PivotFilterCollection collection.

See Also