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

WorksheetFilterSettings

new WorksheetFilterSettings(a: Worksheet, b: boolean): WorksheetFilterSettings

Returns WorksheetFilterSettings

$t: Type

Returns the total region including the filter headers (read-only).

get region(): WorksheetRegion

Returns WorksheetRegion

Returns the region that the filters and sort settings are applied to (read-only).

get sortAndFilterAreaRegion(): WorksheetRegion

Returns WorksheetRegion

Gets the settings which determine how the data within the worksheet's filer region should be sorted.

get sortSettings(): RelativeIndexSortSettings

Returns RelativeIndexSortSettings

Applies an [[AverageFilter]] to the column.

applyAverageFilter(relativeColumnIndex: number, type: AverageFilterType): AverageFilter

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.

applyCustomFilter(relativeColumnIndex: number, condition: CustomFilterCondition): CustomFilter

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 an [[DatePeriodFilter]] to the column.

applyDatePeriodFilter(relativeColumnIndex: number, type: DatePeriodFilterType, value: number): DatePeriodFilter

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.

applyFillFilter(relativeColumnIndex: number, fill: CellFill): FillFilter

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.

applyFixedValuesFilter(relativeColumnIndex: number, includeBlanks: boolean, calendarType: CalendarType, dateGroups: FixedDateGroup[]): FixedValuesFilter

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.

  • dateGroups: FixedDateGroup[]

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

Returns FixedValuesFilter

Applies a [[FontColorFilter]] to the column.

applyFontColorFilter(relativeColumnIndex: number, fontColorInfo: WorkbookColorInfo): FontColorFilter

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 [[IconFilter]] to the column.

applyIconFilter(relativeColumnIndex: number, iconSet: FormatConditionIconSet, iconIndex: number): IconFilter

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.

applyRelativeDateRangeFilter(relativeColumnIndex: number, offset: RelativeDateRangeOffset, duration: RelativeDateRangeDuration): RelativeDateRangeFilter

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.

applyTopOrBottomFilter(relativeColumnIndex: number): TopOrBottomFilter

Parameters

  • relativeColumnIndex: number

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

Returns TopOrBottomFilter

Applies a [[YearToDateFilter]] to the column.

applyYearToDateFilter(relativeColumnIndex: number): YearToDateFilter

Parameters

  • relativeColumnIndex: number

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

Returns YearToDateFilter

Clears the filter that is applied to a specific column.

clearFilter(relativeColumnIndex: number): void

Parameters

  • relativeColumnIndex: number

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

Returns void

Clears all previously applied filters

clearFilters(): void

Returns void

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

clearRegion(): void

Returns void

Gets the filter that is applied to a specific column.

getFilter(relativeColumnIndex: number): Filter

Parameters

  • relativeColumnIndex: number

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

Returns Filter

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

reapplyFilters(): void

Returns void

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

reapplySortConditions(): void

Returns void

Sets the region where the filter settings should be applied

setRegion(address: string): void

Parameters

  • address: string

    The address of the new region.

Returns void

staticInit(): void

Returns void