AutoFilter

AutoFilter class

Represents autofiltering for the specified worksheet.

Methods

NameDescription
addDateFilter(fieldIndex, dateTimeGroupingType, year, month, day, hour, minute, second)Adds a date filter. If DateTimeGroupingType is Year, only the param year effects. If DateTiemGroupingType is Month, only
addFillColorFilter(fieldIndex, pattern, foregroundColor, backgroundColor)Adds a fill color filter.
addFilter(fieldIndex, criteria)Adds a filter for a filter column. MS Excel 2007 supports multiple selection in a filter column.
addFontColorFilter(fieldIndex, color)Adds a font color filter.
addIconFilter(fieldIndex, iconSetType, iconId)Adds an icon filter. Only supports to add the icon filter. Not supports checking which row is visible if the filter is i
custom(fieldIndex, operatorType1, criteria1)Filters a list with a custom criteria.
custom(fieldIndex, operatorType1, criteria1, isAnd, operatorType2, criteria2)Filters a list with custom criteria.
dynamicFilter(fieldIndex, dynamicFilterType)Adds a dynamic filter.
filter(fieldIndex, criteria)Filters a list with specified criteria. Aspose.Cells will remove all other filter setting on this field as Ms Excel 97-2
filterTop10(fieldIndex, isTop, isPercent, itemCount)Filter the top 10 item in the list
getCellArea()Gets the CellArea where the specified AutoFilter applies to.
getCellArea()
getFilterColumns()Gets the collection of the filter columns.
getRange()Represents the range to which the specified AutoFilter applies.
getShowFilterButton()Indicates whether the AutoFilter button for this column is visible.
getSorter()Gets the data sorter.
matchBlanks(fieldIndex)Match all blank cell in the list.
matchNonBlanks(fieldIndex)Match all not blank cell in the list.
refresh()Refresh auto filters to hide or unhide the rows.
refresh(hideRows)Gets all hidden rows’ indexes.
removeDateFilter(fieldIndex, dateTimeGroupingType, year, month, day, hour, minute, second)Removes a date filter. If DateTimeGroupingType is Year, only the param year effects. If DateTiemGroupingType is Month, o
removeFilter(fieldIndex, criteria)Removes a filter for a filter column.
removeFilter(fieldIndex)Remove the specific filter.
setRange()Represents the range to which the specified AutoFilter applies.
setRange(row, startColumn, endColumn)Sets the range to which the specified AutoFilter applies.
setShowFilterButton()Indicates whether the AutoFilter button for this column is visible.
showAll()Unhide all rows.

addDateFilter(fieldIndex, dateTimeGroupingType, year, month, day, hour, minute, second)

Adds a date filter. If DateTimeGroupingType is Year, only the param year effects. If DateTiemGroupingType is Month, only the param year and month effect.

ParameterTypeDescription
fieldIndexNumberThe integer offset of the field on which you want to base the filter (from the left of the list; the leftmost field is field 0).
dateTimeGroupingTypeNumberDateTimeGroupingType
yearNumberThe year.
monthNumberThe month.
dayNumberThe day.
hourNumberThe hour.
minuteNumberThe minute.
secondNumberThe second.

addFillColorFilter(fieldIndex, pattern, foregroundColor, backgroundColor)

Adds a fill color filter.

ParameterTypeDescription
fieldIndexNumberThe integer offset of the field on which you want to base the filter (from the left of the list; the leftmost field is field 0).
patternNumberBackgroundType
foregroundColorCellsColorThe foreground color.
backgroundColorCellsColorThe background color.

addFilter(fieldIndex, criteria)

Adds a filter for a filter column. MS Excel 2007 supports multiple selection in a filter column.

ParameterTypeDescription
fieldIndexNumberThe integer offset of the field on which you want to base the filter (from the left of the list; the leftmost field is field 0).
criteriaStringThe specified criteria (a string; for example, “101”). It only can be null or be one of the cells’ value in this column.

addFontColorFilter(fieldIndex, color)

Adds a font color filter.

ParameterTypeDescription
fieldIndexNumberThe integer offset of the field on which you want to base the filter (from the left of the list; the leftmost field is field 0).
colorCellsColorThe

addIconFilter(fieldIndex, iconSetType, iconId)

Adds an icon filter. Only supports to add the icon filter. Not supports checking which row is visible if the filter is icon filter.

ParameterTypeDescription
fieldIndexNumberThe integer offset of the field on which you want to base the filter (from the left of the list; the leftmost field is field 0).
iconSetTypeNumberIconSetType
iconIdNumberThe icon id.

custom(fieldIndex, operatorType1, criteria1)

Filters a list with a custom criteria.

ParameterTypeDescription
fieldIndexNumberThe integer offset of the field on which you want to base the filter (from the left of the list; the leftmost field is field 0).
operatorType1NumberFilterOperatorType
criteria1ObjectThe custom criteria

custom(fieldIndex, operatorType1, criteria1, isAnd, operatorType2, criteria2)

Filters a list with custom criteria.

ParameterTypeDescription
fieldIndexNumberThe integer offset of the field on which you want to base the filter (from the left of the list; the leftmost field is field 0).
operatorType1NumberFilterOperatorType
criteria1ObjectThe custom criteria
isAndboolean
operatorType2NumberFilterOperatorType
criteria2ObjectThe custom criteria

dynamicFilter(fieldIndex, dynamicFilterType)

Adds a dynamic filter.

ParameterTypeDescription
fieldIndexNumberThe integer offset of the field on which you want to base the filter (from the left of the list; the leftmost field is field 0).
dynamicFilterTypeNumberDynamicFilterType

filter(fieldIndex, criteria)

Filters a list with specified criteria. Aspose.Cells will remove all other filter setting on this field as Ms Excel 97-2003.

ParameterTypeDescription
fieldIndexNumberThe integer offset of the field on which you want to base the filter (from the left of the list; the leftmost field is field 0).
criteriaStringThe specified criteria (a string; for example, “101”).

filterTop10(fieldIndex, isTop, isPercent, itemCount)

Filter the top 10 item in the list

ParameterTypeDescription
fieldIndexNumberThe integer offset of the field on which you want to base the filter (from the left of the list; the leftmost field is field 0).
isTopbooleanIndicates whether filter from top or bottom
isPercentbooleanIndicates whether the items is percent or count
itemCountNumberThe item count

getCellArea()

Gets the CellArea where the specified AutoFilter applies to.

Returns: CellArea — CellArea

getCellArea()

getFilterColumns()

Gets the collection of the filter columns.

getRange()

Represents the range to which the specified AutoFilter applies.

getShowFilterButton()

Indicates whether the AutoFilter button for this column is visible.

getSorter()

Gets the data sorter.

matchBlanks(fieldIndex)

Match all blank cell in the list.

ParameterTypeDescription
fieldIndexNumberThe integer offset of the field on which you want to base the filter (from the left of the list; the leftmost field is field 0).

matchNonBlanks(fieldIndex)

Match all not blank cell in the list.

ParameterTypeDescription
fieldIndexNumberThe integer offset of the field on which you want to base the filter (from the left of the list; the leftmost field is field 0).

refresh()

Refresh auto filters to hide or unhide the rows.

Returns: Array of Number — Array of Number Returns all hidden rows’ indexes.

refresh(hideRows)

Gets all hidden rows’ indexes.

ParameterTypeDescription
hideRowsbooleanIf true, hide the filtered rows.

Returns: Array of Number — Array of Number Returns all hidden rows indexes.

removeDateFilter(fieldIndex, dateTimeGroupingType, year, month, day, hour, minute, second)

Removes a date filter. If DateTimeGroupingType is Year, only the param year effects. If DateTiemGroupingType is Month, only the param year and month effect.

ParameterTypeDescription
fieldIndexNumberThe integer offset of the field on which you want to base the filter (from the left of the list; the leftmost field is field 0).
dateTimeGroupingTypeNumberDateTimeGroupingType
yearNumberThe year.
monthNumberThe month.
dayNumberThe day.
hourNumberThe hour.
minuteNumberThe minute.
secondNumberThe second.

removeFilter(fieldIndex, criteria)

Removes a filter for a filter column.

ParameterTypeDescription
fieldIndexNumberThe integer offset of the field on which you want to base the filter (from the left of the list; the leftmost field is field 0).
criteriaStringThe specified criteria (a string; for example, “101”). It only can be null or be one of the cells’ value in this column.

removeFilter(fieldIndex)

Remove the specific filter.

ParameterTypeDescription
fieldIndexNumberThe specific filter index

setRange()

Represents the range to which the specified AutoFilter applies.

setRange(row, startColumn, endColumn)

Sets the range to which the specified AutoFilter applies.

ParameterTypeDescription
rowNumberRow index.
startColumnNumberStart column index.
endColumnNumberEnd column Index.

setShowFilterButton()

Indicates whether the AutoFilter button for this column is visible.

showAll()

Unhide all rows.