Class AutoFiltersCollection
- Namespace
- Spire.Xls.Collections
- Assembly
- Spire.XLS.dll
public class AutoFiltersCollection : XlsAutoFiltersCollection, IList<object>, ICollection<object>, IEnumerable<object>, IEnumerable, ICloneParent, IAutoFilters, IExcelApplication
- Inheritance
-
AutoFiltersCollection
- Implements
- Inherited Members
Properties
this[int]
Get auto filter item..
public IAutoFilter this[int columnIndex] { get; }
Parameters
columnIndex
int
Property Value
Range
Range to be filtered.
public CellRange Range { get; set; }
Property Value
Worksheet
Returns parent worksheet. Read-only.
public Worksheet Worksheet { get; }
Property Value
Methods
AddDateFilter(IAutoFilter, DateTimeGroupingType, int, int, int, int, int, int)
public void AddDateFilter(IAutoFilter column, DateTimeGroupingType dateTimeGroupingType, int year, int month, int day, int hour, int minute, int second)
Parameters
column
IAutoFilterdateTimeGroupingType
DateTimeGroupingTypeyear
intmonth
intday
inthour
intminute
intsecond
int
AddDateFilter(int, DateTimeGroupingType, int, int, int, int, int, int)
Adds a date filter for a filter column.
public void AddDateFilter(int columnIndex, DateTimeGroupingType dateTimeGroupingType, int year, int month, int day, int hour, int minute, int second)
Parameters
columnIndex
intdateTimeGroupingType
DateTimeGroupingTypeyear
intThe year.
month
intThe month.
day
intThe day.
hour
intThe hour.
minute
intThe minute.
second
intThe second.
Remarks
If DateTimeGroupingType is Year, only the param year effects. If DateTiemGroupingType is Month, only the param year and month effect. and so on.
AddFillColorFilter(IAutoFilter, Color)
public void AddFillColorFilter(IAutoFilter column, Color color)
Parameters
column
IAutoFiltercolor
Color
AddFillColorFilter(int, ExcelPatternType, Color, Color)
Adds a fill color filter.
public void AddFillColorFilter(int columnIndex, ExcelPatternType pattern, Color foreColor, Color backColor)
Parameters
columnIndex
intpattern
ExcelPatternTypeThe background pattern type.
foreColor
ColorbackColor
Color
AddFillColorFilter(int, Color)
Adds a fill color filter.
public void AddFillColorFilter(int filterColumnIndex, Color color)
Parameters
filterColumnIndex
intThe column field index on which you want to base the filter (from the left of the list; the leftmost field is field 0).
color
ColorFill Color.
AddFilter(IAutoFilter, string)
public void AddFilter(IAutoFilter column, string criteria)
Parameters
column
IAutoFiltercriteria
string
AddFilter(int, string)
Adds a filter for a filter column.
public void AddFilter(int columnIndex, string criteria)
Parameters
columnIndex
intcriteria
stringThe specified criteria (a string; for example, "hello"). It only can be null or be one of the cells' value in this column.
AddFontColorFilter(IAutoFilter, Color)
public void AddFontColorFilter(IAutoFilter column, Color color)
Parameters
column
IAutoFiltercolor
Color
AddFontColorFilter(int, Color)
Adds a font color filter.
public void AddFontColorFilter(int columnIndex, Color color)
Parameters
AddIconFilter(int, IconSetType, int)
public void AddIconFilter(int columnIndex, IconSetType iconSetType, int iconId)
Parameters
columnIndex
inticonSetType
IconSetTypeiconId
int
Clear()
public void Clear()
ClearFilter(int)
Delete the column filter by column index(filters column index not sheet column index)
public void ClearFilter(int filterColumnIndex)
Parameters
filterColumnIndex
int
ClearFilter(string)
Delete the column filter by column name
public void ClearFilter(string columnName)
Parameters
columnName
string
CustomFilter(FilterColumn, FilterOperatorType, object)
public void CustomFilter(FilterColumn column, FilterOperatorType operatorType, object criteria)
Parameters
column
FilterColumnoperatorType
FilterOperatorTypecriteria
object
CustomFilter(FilterColumn, FilterOperatorType, object, bool, FilterOperatorType, object)
public void CustomFilter(FilterColumn column, FilterOperatorType operatorType1, object criteria1, bool isAnd, FilterOperatorType operatorType2, object criteria2)
Parameters
column
FilterColumnoperatorType1
FilterOperatorTypecriteria1
objectisAnd
booloperatorType2
FilterOperatorTypecriteria2
object
CustomFilter(int, FilterOperatorType, object)
Filters a list with a custom criteria.
public void CustomFilter(int columnIndex, FilterOperatorType operatorType, object criteria)
Parameters
columnIndex
intoperatorType
FilterOperatorTypeThe filter operator type
criteria
objectThe custom criteria
CustomFilter(int, FilterOperatorType, object, bool, FilterOperatorType, object)
Filters a list with custom criterias.
public void CustomFilter(int columnIndex, FilterOperatorType operatorType1, object criteria1, bool isAnd, FilterOperatorType operatorType2, object criteria2)
Parameters
columnIndex
intoperatorType1
FilterOperatorTypeThe first filter operator type
criteria1
objectThe first custom criteria
isAnd
booloperatorType2
FilterOperatorTypeThe second filter operator type
criteria2
objectThe second custom criteria
DynamicFilter(IAutoFilter, DynamicFilterType)
public void DynamicFilter(IAutoFilter column, DynamicFilterType dynamicFilterType)
Parameters
column
IAutoFilterdynamicFilterType
DynamicFilterType
DynamicFilter(int, DynamicFilterType)
Adds a dynamic filter.
public void DynamicFilter(int columnIndex, DynamicFilterType dynamicFilterType)
Parameters
columnIndex
intdynamicFilterType
DynamicFilterTypeDynamic filter type.
Filter()
Filter the data.
public void Filter()
Filter(bool)
Gets all hidden rows's indexes.
public int[] Filter(bool hideRows)
Parameters
hideRows
boolIf true, hide the filtered rows.
Returns
- int[]
Returns all hidden rows indexes.
FilterTop10(IAutoFilter, bool, bool, int)
Filter the top 10 item in the list
public void FilterTop10(IAutoFilter column, bool isTop, bool isPercent, int itemCount)
Parameters
column
IAutoFilterThe column field on which you want to base the filter. for exapmle: sheet.AutoFilters[0]
isTop
boolIndicates whether filter from top or bottom
isPercent
boolIndicates whether the items is percent or count
itemCount
intThe item count
FilterTop10(int, bool, bool, int)
Filter the top 10 item in the list
public void FilterTop10(int filterColumnIndex, bool isTop, bool isPercent, int itemCount)
Parameters
filterColumnIndex
intThe column field index on which you want to base the filter (from the left of the list; the leftmost field is field 0).
isTop
boolIndicates whether filter from top or bottom
isPercent
boolIndicates whether the items is percent or count
itemCount
intThe item count
MatchBlanks(IAutoFilter)
Match all blank cell in the list.
public void MatchBlanks(IAutoFilter column)
Parameters
column
IAutoFilterThe column field on which you want to base the filter . for exapmle: sheet.AutoFilters[0]
MatchBlanks(int)
Match all blank cell in the list.
public void MatchBlanks(int columnIndex)
Parameters
columnIndex
int
MatchNonBlanks(FilterColumn)
Match all not blank cell in the list.
public void MatchNonBlanks(FilterColumn column)
Parameters
column
FilterColumnThe column field on which you want to base the filter . for exapmle: sheet.AutoFilters[0]
MatchNonBlanks(int)
Match all not blank cell in the list.
public void MatchNonBlanks(int filterColumnIndex)
Parameters
filterColumnIndex
intThe column field index on which you want to base the filter (from the left of the list; the leftmost field is field 0).
QuickFilter(IAutoFilter, string)
public void QuickFilter(IAutoFilter column, string criteria)
Parameters
column
IAutoFiltercriteria
string
QuickFilter(int, string)
Filters a list with specified criteria.
public void QuickFilter(int columnIndex, string criteria)
Parameters
Remarks
will remove all other filter setting on this field as Ms Excel 97-2003.
RemoveDateFilter(int, DateTimeGroupingType, int, int, int, int, int, int)
Removes a date filter.
public void RemoveDateFilter(int columnIndex, DateTimeGroupingType dateTimeGroupingType, int year, int month, int day, int hour, int minute, int second)
Parameters
columnIndex
intdateTimeGroupingType
DateTimeGroupingTypeyear
intThe year.
month
intThe month.
day
intThe day.
hour
intThe hour.
minute
intThe minute.
second
intThe second.
Remarks
If DateTimeGroupingType is Year, only the param year effects. If DateTiemGroupingType is Month, only the param year and month effect.
RemoveFilter(int, string)
Removes a filter for a filter column.
public void RemoveFilter(int columnIndex, string criteria)