Represents a filter applied to a PivotTable field.
NuGet Package: DevExpress.Spreadsheet.Core
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")