Table of Contents

Class ExcelPivotTableFieldFilterCollection

Namespace
OfficeOpenXml.Table.PivotTable.Filter
Assembly
EPPlus.dll

A collection of pivot filters for a pivot table field

public class ExcelPivotTableFieldFilterCollection : ExcelPivotTableFilterBaseCollection, IEnumerable<ExcelPivotTableFilter>, IEnumerable
Inheritance
ExcelPivotTableFieldFilterCollection
Implements
Inherited Members

Methods

AddCaptionFilter(ePivotTableCaptionFilterType, string, string)

Adds a caption (label) filter for a pivot tabel field

public ExcelPivotTableFilter AddCaptionFilter(ePivotTableCaptionFilterType type, string value1, string value2 = null)

Parameters

type ePivotTableCaptionFilterType

The type of pivot table caption filter

value1 string

Value 1

value2 string

Value 2. Set to null, if not used

Returns

ExcelPivotTableFilter

AddDatePeriodFilter(ePivotTableDatePeriodFilterType)

Adds a date period filter for a pivot table field.

public ExcelPivotTableFilter AddDatePeriodFilter(ePivotTableDatePeriodFilterType type)

Parameters

type ePivotTableDatePeriodFilterType

The type of field.

Returns

ExcelPivotTableFilter

The pivot table filter

AddDateValueFilter(ePivotTableDateValueFilterType, DateTime, DateTime?)

Adds a date filter for a pivot table field

public ExcelPivotTableFilter AddDateValueFilter(ePivotTableDateValueFilterType type, DateTime value1, DateTime? value2 = null)

Parameters

type ePivotTableDateValueFilterType

The type of pivot table filter.

value1 DateTime

Value 1

value2 DateTime?

Value 2. Set to null, if not used

Returns

ExcelPivotTableFilter

The pivot table filter

Exceptions

ArgumentNullException

Thrown if value is between and value2 is null

AddTop10Filter(ePivotTableTop10FilterType, ExcelPivotTableDataField, double, bool)

Adds a top 10 filter to the field

public ExcelPivotTableFilter AddTop10Filter(ePivotTableTop10FilterType type, ExcelPivotTableDataField dataField, double value, bool isTop = true)

Parameters

type ePivotTableTop10FilterType

The top-10 filter type

dataField ExcelPivotTableDataField

The datafield within the pivot table

value double

The top or bottom value to relate to

isTop bool

Top or bottom. true is Top, false is Bottom

Returns

ExcelPivotTableFilter

AddTop10Filter(ePivotTableTop10FilterType, int, double, bool)

Adds a top 10 filter to the field

public ExcelPivotTableFilter AddTop10Filter(ePivotTableTop10FilterType type, int dataFieldIndex, double value, bool isTop = true)

Parameters

type ePivotTableTop10FilterType

The top-10 filter type

dataFieldIndex int

The index to the data field within the pivot tables DataField collection

value double

The top or bottom value to relate to

isTop bool

Top or bottom. true is Top, false is Bottom

Returns

ExcelPivotTableFilter

AddValueFilter(ePivotTableValueFilterType, ExcelPivotTableDataField, object, object)

Adds a pivot table value filter.

public ExcelPivotTableFilter AddValueFilter(ePivotTableValueFilterType type, ExcelPivotTableDataField dataField, object value1, object value2 = null)

Parameters

type ePivotTableValueFilterType

The type of value filter

dataField ExcelPivotTableDataField

The data field to apply the filter to

value1 object

Value 1

value2 object

Value 2. Used with ValueBetween and ValueNotBetween

Returns

ExcelPivotTableFilter

The pivot table filter

Exceptions

ArgumentException

If the data field is not present in the pivot table.

ArgumentNullException

If value2 is not set when type is set to between

AddValueFilter(ePivotTableValueFilterType, int, object, object)

Adds a pivot table value filter.

public ExcelPivotTableFilter AddValueFilter(ePivotTableValueFilterType type, int dataFieldIndex, object value1, object value2 = null)

Parameters

type ePivotTableValueFilterType

The type of value filter

dataFieldIndex int

The index of the ExcelPivotTableDataField to apply the filter to.

value1 object

Value 1

value2 object

Value 2. Used with ValueBetween and ValueNotBetween

Returns

ExcelPivotTableFilter

The pivot table filter

Exceptions

ArgumentException

If the data field is not present in the pivot table.

ArgumentNullException

If value2 is not set when type is set to between