GemBox.Spreadsheet
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    PivotTableFilter Class

    Namespace:
    GemBox.Spreadsheet.PivotTables
    Assembly:
    GemBox.Spreadsheet.dll

    Represents PivotTable filter settings and provides filter functionality.

    • C#
    • VB.NET
    public sealed class PivotTableFilter
    Public NotInheritable Class PivotTableFilter
    Inheritance:
    System.Object
    PivotTableFilter

    Properties

    PivotFilters

    Gets the filter fields.

    • C#
    • VB.NET
    public PivotFilterCollection PivotFilters { get; }
    Public ReadOnly Property PivotFilters As PivotFilterCollection
    Property Value
    PivotFilterCollection

    The filter fields.

    PivotTable

    Gets the PivotTable to filter.

    • C#
    • VB.NET
    public PivotTable PivotTable { get; }
    Public ReadOnly Property PivotTable As PivotTable
    Property Value
    PivotTable

    The PivotTable to filter.

    Methods

    ByCustom(PivotField, FilterOperator, Object)

    Sets a CustomFilter to a pivot field.

    CustomFilter filters by a one or two conditions (operators and values).

    • C#
    • VB.NET
    public PivotTableFilter ByCustom(PivotField field, FilterOperator operator, object value)
    Public Function ByCustom(field As PivotField, operator As FilterOperator, value As Object) As PivotTableFilter
    Parameters
    field
    PivotField

    The pivot field that a set Top10Filter applies to.

    operator
    FilterOperator

    The operator used by the filter condition.

    value
    System.Object

    The value used by the filter condition.

    Returns
    PivotTableFilter

    This PivotTableFilter to specify additional filters or to apply filter.

    Remarks

    If PivotFilter already specifies a filter (Filter is not equal to null), it will be overridden.

    Exceptions
    System.NotSupportedException

    Value's type is not supported.

    ByCustom(PivotField, FilterOperator, Object, Boolean, FilterOperator, Object)

    Sets a CustomFilter to a pivot field.

    CustomFilter filters by a one or two conditions (operators and values).

    • C#
    • VB.NET
    public PivotTableFilter ByCustom(PivotField field, FilterOperator operator, object value, bool and, FilterOperator operator2, object value2)
    Public Function ByCustom(field As PivotField, operator As FilterOperator, value As Object, and As Boolean, operator2 As FilterOperator, value2 As Object) As PivotTableFilter
    Parameters
    field
    PivotField

    The pivot field that a set CustomFilter applies to.

    operator
    FilterOperator

    The operator used by the (first) filter condition.

    value
    System.Object

    The value used by the (first) filter condition.

    and
    System.Boolean

    The value indicating whether the two conditions have an "and" relationship. true indicates "and" and false indicates "or".

    operator2
    FilterOperator

    The operator used by the second filter condition.

    value2
    System.Object

    The value used by the second filter condition.

    Returns
    PivotTableFilter

    This PivotTableFilter to specify additional filters or to apply filter.

    Remarks

    If PivotFilter already specifies a filter (Filter is not equal to null), it will be overridden.

    Exceptions
    System.NotSupportedException

    Value's type is not supported.

    ByCustom(PivotField, PivotField, FilterOperator, Object)

    Sets a CustomFilter to a pivot field.

    CustomFilter filters by a one or two conditions (operators and values).

    • C#
    • VB.NET
    public PivotTableFilter ByCustom(PivotField field, PivotField measureField, FilterOperator operator, object value)
    Public Function ByCustom(field As PivotField, measureField As PivotField, operator As FilterOperator, value As Object) As PivotTableFilter
    Parameters
    field
    PivotField

    The pivot field that a set Top10Filter applies to.

    measureField
    PivotField

    The pivot field containing summary values being filtered.

    operator
    FilterOperator

    The operator used by the filter condition.

    value
    System.Object

    The value used by the filter condition.

    Returns
    PivotTableFilter

    This PivotTableFilter to specify additional filters or to apply filter.

    Remarks

    If PivotFilter already specifies a filter (Filter is not equal to null), it will be overridden.

    Exceptions
    System.NotSupportedException

    Value's type is not supported.

    ByCustom(PivotField, PivotField, FilterOperator, Object, Boolean, FilterOperator, Object)

    Sets a CustomFilter to a pivot field.

    CustomFilter filters by a one or two conditions (operators and values).

    • C#
    • VB.NET
    public PivotTableFilter ByCustom(PivotField field, PivotField measureField, FilterOperator operator, object value, bool and, FilterOperator operator2, object value2)
    Public Function ByCustom(field As PivotField, measureField As PivotField, operator As FilterOperator, value As Object, and As Boolean, operator2 As FilterOperator, value2 As Object) As PivotTableFilter
    Parameters
    field
    PivotField

    The pivot field that a set CustomFilter applies to.

    measureField
    PivotField

    The pivot field containing summary values being filtered.

    operator
    FilterOperator

    The operator used by the (first) filter condition.

    value
    System.Object

    The value used by the (first) filter condition.

    and
    System.Boolean

    The value indicating whether the two conditions have an "and" relationship. true indicates "and" and false indicates "or".

    operator2
    FilterOperator

    The operator used by the second filter condition.

    value2
    System.Object

    The value used by the second filter condition.

    Returns
    PivotTableFilter

    This PivotTableFilter to specify additional filters or to apply filter.

    Remarks

    If PivotFilter already specifies a filter (Filter is not equal to null), it will be overridden.

    Exceptions
    System.NotSupportedException

    Value's type is not supported.

    ByDynamic(PivotField, DynamicFilterType)

    Sets a DynamicFilter to a pivot field.

    DynamicFilter filters by a dynamic criteria that can change, either with the data itself (e.g., "above average") or with the current system date (e.g., show values for "today").

    • C#
    • VB.NET
    public PivotTableFilter ByDynamic(PivotField field, DynamicFilterType dynamicFilterType)
    Public Function ByDynamic(field As PivotField, dynamicFilterType As DynamicFilterType) As PivotTableFilter
    Parameters
    field
    PivotField

    The pivot field that a set DynamicFilter applies to.

    dynamicFilterType
    DynamicFilterType

    The dynamic filter type.

    Returns
    PivotTableFilter

    This PivotTableFilter to specify additional filters or to apply filter.

    Remarks

    If PivotFilter already specifies a filter (Filter is not equal to null), it will be overridden.

    ByDynamic(PivotField, PivotField, DynamicFilterType)

    Sets a DynamicFilter to a pivot field.

    DynamicFilter filters by a dynamic criteria that can change, either with the data itself (e.g., "above average") or with the current system date (e.g., show values for "today").

    • C#
    • VB.NET
    public PivotTableFilter ByDynamic(PivotField field, PivotField measureField, DynamicFilterType dynamicFilterType)
    Public Function ByDynamic(field As PivotField, measureField As PivotField, dynamicFilterType As DynamicFilterType) As PivotTableFilter
    Parameters
    field
    PivotField

    The pivot field that a set DynamicFilter applies to.

    measureField
    PivotField

    The pivot field containing summary values being filtered.

    dynamicFilterType
    DynamicFilterType

    The dynamic filter type.

    Returns
    PivotTableFilter

    This PivotTableFilter to specify additional filters or to apply filter.

    Remarks

    If PivotFilter already specifies a filter (Filter is not equal to null), it will be overridden.

    ByTop10(PivotField, PivotField, Boolean, Boolean, Double)

    Sets a Top10Filter to a pivot field.

    Top10Filter filters by a top N (percent or number of items).

    • C#
    • VB.NET
    public PivotTableFilter ByTop10(PivotField field, PivotField measureField, bool top, bool percent, double value)
    Public Function ByTop10(field As PivotField, measureField As PivotField, top As Boolean, percent As Boolean, value As Double) As PivotTableFilter
    Parameters
    field
    PivotField

    The pivot field that a set Top10Filter applies to.

    measureField
    PivotField

    The pivot field containing summary values being filtered.

    top
    System.Boolean

    a value indicating whether or not to filter by top order. A false value filters by bottom order.

    percent
    System.Boolean

    A value indicating whether or not to filter by percent value of the pivot field. A false value filters by number of items.

    value
    System.Double

    The top or bottom value to use as the filter criteria. For example "Filter by Top 10 Percent" or "Filter by Top 5 Items".

    Returns
    PivotTableFilter

    This PivotTableFilter to specify additional filters or to apply filter.

    Remarks

    If PivotFilter already specifies a filter (Filter is not equal to null), it will be overridden.

    Exceptions
    System.ArgumentOutOfRangeException

    value must be greater than zero.

    ByTop10(PivotField, Boolean, Boolean, Double)

    Sets a Top10Filter to a pivot field.

    Top10Filter filters by a top N (percent or number of items).

    • C#
    • VB.NET
    public PivotTableFilter ByTop10(PivotField field, bool top, bool percent, double value)
    Public Function ByTop10(field As PivotField, top As Boolean, percent As Boolean, value As Double) As PivotTableFilter
    Parameters
    field
    PivotField

    The pivot field that a set Top10Filter applies to.

    top
    System.Boolean

    a value indicating whether or not to filter by top order. A false value filters by bottom order.

    percent
    System.Boolean

    A value indicating whether or not to filter by percent value of the pivot field. A false value filters by number of items.

    value
    System.Double

    The top or bottom value to use as the filter criteria. For example "Filter by Top 10 Percent" or "Filter by Top 5 Items".

    Returns
    PivotTableFilter

    This PivotTableFilter to specify additional filters or to apply filter.

    Remarks

    If PivotFilter already specifies a filter (Filter is not equal to null), it will be overridden.

    Exceptions
    System.ArgumentOutOfRangeException

    value must be greater than zero.

    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.