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
ePivotTableCaptionFilterTypeThe type of pivot table caption filter
value1
stringValue 1
value2
stringValue 2. Set to null, if not used
Returns
AddDatePeriodFilter(ePivotTableDatePeriodFilterType)
Adds a date period filter for a pivot table field.
public ExcelPivotTableFilter AddDatePeriodFilter(ePivotTableDatePeriodFilterType type)
Parameters
type
ePivotTableDatePeriodFilterTypeThe 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
ePivotTableDateValueFilterTypeThe type of pivot table filter.
value1
DateTimeValue 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
ePivotTableTop10FilterTypeThe top-10 filter type
dataField
ExcelPivotTableDataFieldThe datafield within the pivot table
value
doubleThe top or bottom value to relate to
isTop
boolTop or bottom. true is Top, false is Bottom
Returns
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
ePivotTableTop10FilterTypeThe top-10 filter type
dataFieldIndex
intThe index to the data field within the pivot tables DataField collection
value
doubleThe top or bottom value to relate to
isTop
boolTop or bottom. true is Top, false is Bottom
Returns
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
ePivotTableValueFilterTypeThe type of value filter
dataField
ExcelPivotTableDataFieldThe data field to apply the filter to
value1
objectValue 1
value2
objectValue 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
ePivotTableValueFilterTypeThe type of value filter
dataFieldIndex
intThe index of the ExcelPivotTableDataField to apply the filter to.
value1
objectValue 1
value2
objectValue 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