Exposes methods to identify a region in the wroksheet and to apply filters and optionally sort criteria to that region.

Hierarchy

Hierarchy

  • Base
    • WorksheetFilterSettings

Implements

  • ISortSettingsOwner
  • IChangeInfoContext

Constructors

Properties

$type: Type
$t: Type
nextHashCode: number

Accessors

  • get region(): WorksheetRegion
  • Returns the total region including the filter headers (read-only).

    See

    • [[setRegion]]
    • [[setRegion]]
    • [[sortAndFilterAreaRegion]]

    Returns WorksheetRegion

  • get sortAndFilterAreaRegion(): WorksheetRegion
  • Returns the region that the filters and sort settings are applied to (read-only).

    See

    • [[setRegion]]
    • [[setRegion]]
    • [[region]]
    • [[sortSettings]]

    Returns WorksheetRegion

  • get sortSettings(): RelativeIndexSortSettings
  • Gets the settings which determine how the data within the worksheet's filer region should be sorted.

    Note: Sort conditions are not constantly evaluated as data within the region changes. Sort conditions are applied to the region only when they are are added or removed or when the [[reapplySortConditions]] method is called.

    See

    [[reapplySortConditions]]

    Returns RelativeIndexSortSettings

Methods

  • Applies an [[AverageFilter]] to the column.

    Throws

    [[InvalidOperationException]] If the [[region]] was not set.

    Throws

    [[ArgumentOutOfRangeException]] If the relativeColumnIndex is outside of the [[region]].

    Throws

    [[InvalidEnumArgumentException]] 'type' is not defined in the [[AverageFilterType]] enumeration.

    See

    • [[AverageFilter]]
    • [[getFilter]]
    • [[clearFilters]]

    Parameters

    • relativeColumnIndex: number

      A zero based column index relative to the [[region]]

    • type: AverageFilterType

      The value indicating whether to filter in values below or above the average of the data range.

    Returns AverageFilter

  • Applies a [[CustomFilter]] to the column.

    Note: If the filter condition value is longer than 255 characters in length and the workbook is saved in one of the 2003 formats, the correct rows will be hidden in the saved file, but the filter will be missing from the column.

    Throws

    [[ArgumentNullException]] 'condition' is null.

    Throws

    [[InvalidOperationException]] If the [[region]] was not set.

    Throws

    [[ArgumentOutOfRangeException]] If the relativeColumnIndex is outside of the [[region]].

    See

    • [[CustomFilter]]
    • [[getFilter]]
    • [[clearFilter]]

    Parameters

    • relativeColumnIndex: number

      A zero based column index relative to the [[region]]

    • condition: CustomFilterCondition

      The condition which must pass for the data to be filtered in.

    Returns CustomFilter

  • Applies a [[CustomFilter]] to the column.

    If 'condition2' is null, the 'conditionalOperator' value is irrelevant.

    Note: If one of the filter condition values is longer than 255 characters in length and the workbook is saved in one of the 2003 formats, the correct rows will be hidden in the saved file, but the filter will be missing from the column.

    Throws

    [[ArgumentNullException]] 'condition1' is null.

    Throws

    [[InvalidEnumArgumentException]] 'conditionalOperator' is not defined in the [[ConditionalOperator]] enumeration.

    Throws

    [[InvalidOperationException]] If the [[region]] was not set.

    Throws

    [[ArgumentOutOfRangeException]] If the relativeColumnIndex is outside of the [[region]].

    See

    • [[CustomFilter]]
    • [[getFilter]]
    • [[clearFilter]]

    Parameters

    • relativeColumnIndex: number

      A zero based column index relative to the [[region]]

    • condition1: CustomFilterCondition

      The first condition used to filter the data.

    • condition2: CustomFilterCondition

      The second condition used to filter the data.

    • conditionalOperator: ConditionalOperator

      The operator which defines how to logically combine 'condition1' and 'condition2'.

    Returns CustomFilter

  • Applies an [[DatePeriodFilter]] to the column.

    If the 'type' is Month, a 'value' of 1 indicates January, 2 indicates February, and so on. If type is Quarter, a value of 1 indicates Quarter 1, and so on.

    Throws

    [[InvalidOperationException]] If the [[region]] was not set.

    Throws

    [[ArgumentOutOfRangeException]] If the relativeColumnIndex is outside of the [[region]].

    Throws

    [[InvalidEnumArgumentException]] 'type' is not defined in the [[DatePeriodFilterType]] enumeration.

    Throws

    [[ArgumentException]] 'type' is Quarter and 'value' is less than 1 or greater than 4 or type is Month and value is less than 1 or greater than 12.

    See

    • [[DatePeriodFilter]]
    • [[getFilter]]
    • [[clearFilter]]

    Parameters

    • relativeColumnIndex: number

      A zero based column index relative to the [[region]]

    • type: DatePeriodFilterType

      The type of date period to filter in.

    • value: number

      The 1-based value of the month or quarter to filter in.

    Returns DatePeriodFilter

  • Applies a [[FillFilter]] to the column.

    Throws

    [[ArgumentNullException]] 'fill' is null.

    Throws

    [[InvalidOperationException]] If the [[region]] was not set.

    Throws

    [[ArgumentOutOfRangeException]] If the relativeColumnIndex is outside of the [[region]].

    See

    • [[FillFilter]]
    • [[getFilter]]
    • [[clearFilter]]

    Parameters

    • relativeColumnIndex: number

      A zero based column index relative to the [[region]]

    • fill: CellFill

      A [[CellFill]] by which the cells should be filtered.

    Returns FillFilter

  • Applies a [[FixedValuesFilter]] to the column.

    Throws

    [[ArgumentNullException]] 'dateGroups' is null.

    Throws

    [[InvalidEnumArgumentException]] 'calendarType' is not defined in the [[CalendarType]] enumeration.

    Throws

    [[ArgumentNullException]] A FixedDateGroup in the 'dateGroups' collection is null.

    Throws

    [[ArgumentException]] Multiple items in 'dateGroups' are equal to each other.

    Throws

    [[InvalidOperationException]] 'includeBlanks' is False and 'dateGroups' has no items. At least one value must be allowed.

    Throws

    [[InvalidOperationException]] If the [[region]] was not set.

    Throws

    [[ArgumentOutOfRangeException]] If the relativeColumnIndex is outside of the [[region]].

    See

    • [[FixedValuesFilter]]
    • [[getFilter]]
    • [[clearFilter]]

    Parameters

    • relativeColumnIndex: number

      A zero based column index relative to the [[region]]

    • includeBlanks: boolean

      The value which indicates whether blank cells should be filtered in.

    • calendarType: CalendarType

      The calendar type used to interpret values in the 'dateGroups' collection.

    • Rest ...dateGroups: FixedDateGroup[]

      The collection of fixed date groups which should be filtered in.

    Returns FixedValuesFilter

  • Applies a [[FontColorFilter]] to the column.

    Throws

    [[ArgumentNullException]] 'fontColorInfo' is null.

    Throws

    [[InvalidOperationException]] If the [[region]] was not set.

    Throws

    [[ArgumentOutOfRangeException]] If the relativeColumnIndex is outside of the [[region]].

    See

    • [[FontColorFilter]]
    • [[getFilter]]
    • [[clearFilter]]

    Parameters

    • relativeColumnIndex: number

      A zero based column index relative to the [[region]]

    • fontColorInfo: WorkbookColorInfo

      A [[WorkbookColorInfo]] which describes the font color by which the cells should be filtered.

    Returns FontColorFilter

  • Applies a [[FontColorFilter]] to the column.

    Throws

    [[ArgumentNullException]] 'fontColor' is empty.

    Throws

    [[InvalidOperationException]] If the [[region]] was not set.

    Throws

    [[ArgumentOutOfRangeException]] If the relativeColumnIndex is outside of the [[region]].

    See

    • [[FontColorFilter]]
    • [[getFilter]]
    • [[clearFilter]]

    Parameters

    • relativeColumnIndex: number

      A zero based column index relative to the [[region]]

    • fontColor: string | Color

      The font color by which the cells should be filtered.

    Returns FontColorFilter

  • Applies a [[IconFilter]] to the column.

    Throws

    [[ArgumentException]] If the icon set is not valid.

    Throws

    [[IndexOutOfRangeException]] If the index is less than zero or greater than or equal to the number of icons in the icon set..

    Throws

    [[InvalidOperationException]] The [[WorksheetTable.isFilterUIVisible]] value of the owning table is False. Filters cannot be applied when the header row or filter button is hidden.

    Throws

    [[InvalidOperationException]] If column was removed from the table.

    Throws

    [[ArgumentOutOfRangeException]] If the relativeColumnIndex is outside of the [[region]].

    Throws

    [[InvalidEnumArgumentException]] 'iconSet' is not defined in the [[FormatConditionIconSet]] enumeration.

    See

    • [[IconFilter]]
    • [[Filter]]
    • [[clearFilter]]
    • [[ConditionalFormatCollection.addIconSetCondition]]

    Parameters

    • relativeColumnIndex: number

      A zero based column index relative to the [[region]]

    • iconSet: FormatConditionIconSet

      The icon set containing the icon.

    • iconIndex: number

      The zero-based index of the icon in the set or null for 'NoCellIcon'.

    Returns IconFilter

  • Applies a [[RelativeDateRangeFilter]] to the column.

    The RelativeDateRangeFilter allows you to filter in dates which are in the previous, current, or next time period relative to the date when the filter was applied. The time periods available are day, week, month, quarter, year. So when using the previous filter type with a day duration, a 'yesterday' filter is created. Or when using a current filter type with a year duration, a 'this year' filter is created. However, these filters compare the data against the date when the filter was created. So a 'this year' filter created in 1999 will filter in all cells containing dates in 1999, even if the workbook is opened in 2012.

    Throws

    [[InvalidEnumArgumentException]] 'offset' is not defined in the [[RelativeDateRangeOffset]] enumeration.

    Throws

    [[InvalidEnumArgumentException]] 'duration' is not defined in the [[RelativeDateRangeDuration]] enumeration.

    Throws

    [[InvalidOperationException]] If the [[region]] was not set.

    Throws

    [[ArgumentOutOfRangeException]] If the relativeColumnIndex is outside of the [[region]].

    See

    • [[RelativeDateRangeFilter]]
    • [[getFilter]]
    • [[clearFilter]]

    Parameters

    • relativeColumnIndex: number

      A zero based column index relative to the [[region]]

    • offset: RelativeDateRangeOffset

      The offset of relative filter. This combined with the 'duration' determines the full range of accepted dates.

    • duration: RelativeDateRangeDuration

      The duration of the full range of accepted dates.

    Returns RelativeDateRangeFilter

  • Applies a [[TopOrBottomFilter]] to the column which will filter in the top 10 values in the list of sorted values.

    Throws

    [[InvalidOperationException]] If the [[region]] was not set.

    Throws

    [[ArgumentOutOfRangeException]] If the relativeColumnIndex is outside of the [[region]].

    See

    • [[TopOrBottomFilter]]
    • [[getFilter]]
    • [[clearFilter]]

    Parameters

    • relativeColumnIndex: number

      A zero based column index relative to the [[region]]

    Returns TopOrBottomFilter

  • Applies a [[TopOrBottomFilter]] to the column.

    Throws

    [[InvalidEnumArgumentException]] 'type' is not defined in the [[TopOrBottomFilterType]] enumeration.

    Throws

    [[ArgumentOutOfRangeException]] 'value' is less than 1 or greater than 500.

    Throws

    [[InvalidOperationException]] If the [[region]] was not set.

    Throws

    [[ArgumentOutOfRangeException]] If the relativeColumnIndex is outside of the [[region]].

    See

    • [[TopOrBottomFilter]]
    • [[getFilter]]
    • [[clearFilter]]

    Parameters

    • relativeColumnIndex: number

      A zero based column index relative to the [[region]]

    • type: TopOrBottomFilterType

      The type of the filter.

    • value: number

      The number or percentage of value of values which should be filtered in.

    Returns TopOrBottomFilter

  • Applies a [[YearToDateFilter]] to the column.

    Throws

    [[InvalidOperationException]] If the [[region]] was not set.

    Throws

    [[ArgumentOutOfRangeException]] If the relativeColumnIndex is outside of the [[region]].

    See

    • [[YearToDateFilter]]
    • [[Filter]]
    • [[clearFilter]]

    Parameters

    • relativeColumnIndex: number

      A zero based column index relative to the [[region]]

    Returns YearToDateFilter

  • Clears the filter that is applied to a specific column.

    Throws

    [[InvalidOperationException]] If the [[region]] was not set.

    Throws

    [[ArgumentOutOfRangeException]] If the relativeColumnIndex is outside of the [[region]].

    Parameters

    • relativeColumnIndex: number

      A zero based column index relative to the [[region]]

    Returns void

  • Clears all previously applied filters

    Returns void

  • Clears the region as well as any existing filters and sort criteria

    See

    • [[setRegion]]
    • [[setRegion]]

    Returns void

  • Parameters

    • other: any

    Returns boolean

  • Gets the filter that is applied to a specific column.

    Throws

    [[InvalidOperationException]] If the [[region]] was not set.

    Throws

    [[ArgumentOutOfRangeException]] If the relativeColumnIndex is outside of the [[region]].

    Parameters

    • relativeColumnIndex: number

      A zero based column index relative to the [[region]]

    Returns Filter

  • Returns number

  • Returns Base

  • Re-filters all data cells in the filter region based on the applied filters.

    Filters are not constantly evaluated as data within the region changes. Filters are applied to the region only when they are added or removed or when the ReapplyFilters method is called.

    If no filters are applied this method will not do anything to the data.

    Note: When the filters are reevaluated, the rows of any cells which don't meet the filter criteria of their column will be hidden. When a row is filtered out, the entire row is hidden from the worksheet, so any data outside the table but in the same row will also be hidden.

    See

    [[clearFilters]]

    Returns void

  • Re-sorts all data cells in the region based on the sort conditions.

    See

    [[sortSettings]]

    Returns void

  • Sets the region where the filter settings should be applied

    The [[Workbook.cellReferenceMode]] of the workbook will be used to parse the region address.

    Note: setting the region will clear any applied filters or sort criteria.

    Throws

    [[InvalidOperationException]] If the region intersects with a table of other reserved area in the worksheet.

    See

    • [[region]]
    • [[setRegion]]
    • [[clearRegion]]

    Parameters

    • address: string

      The address of the new region.

    Returns void

  • Sets the region where the filter settings should be applied

    Note: setting the region will clear any applied filters or sort criteria.

    Throws

    [[InvalidOperationException]] If the region intersects with a table of other reserved area in the worksheet.

    See

    • [[region]]
    • [[setRegion]]
    • [[clearRegion]]

    Parameters

    • address: string

      The address of the new region.

    • cellReferenceMode: CellReferenceMode

      The reference to use the parse the address.

    Returns void

  • Parameters

    • item1: any
    • item2: any

    Returns number

  • Parameters

    • item1: any
    • item2: any

    Returns number

  • Parameters

    • item1: any
    • item2: any

    Returns boolean

  • Parameters

    • a: any
    • b: any

    Returns boolean

  • Parameters

    • obj: any

    Returns any[]

  • Parameters

    • obj: any

    Returns any[]

  • Parameters

    • obj: any

    Returns number

  • Parameters

    • a: any
    • b: any

    Returns boolean

  • Returns void