AutoFilter class
AutoFilter class
Represents autofiltering for the specified worksheet.
The AutoFilter type exposes the following members:
Properties
Property | Description |
---|---|
sorter | Gets the data sorter. |
range | Represents the range to which the specified AutoFilter applies. |
show_filter_button | Indicates whether the AutoFilter button for this column is visible. |
filter_columns | Gets the collection of the filter columns. |
Methods
Method | Description |
---|---|
get_cell_area | Gets the CellArea where the this AutoFilter applies to. |
get_cell_area | Gets the CellArea where the specified AutoFilter applies to. |
remove_filter | Removes a filter for a filter column. |
remove_filter | Remove the specific filter. |
custom | Filters a list with a custom criteria. |
custom | Filters a list with custom criteria. |
refresh | Refresh auto filters to hide or unhide the rows. |
refresh | Gets all hidden rows’ indexes. |
set_range | Sets the range to which the specified AutoFilter applies. |
add_filter | Adds a filter for a filter column. |
add_date_filter | Adds a date filter. |
remove_date_filter | Removes a date filter. |
filter | Filters a list with specified criteria. |
filter_top10 | Filter the top 10 item in the list |
dynamic_filter | Adds a dynamic filter. |
add_font_color_filter | Adds a font color filter. |
add_fill_color_filter | Adds a fill color filter. |
add_icon_filter | Adds an icon filter. |
match_blanks | Match all blank cell in the list. |
match_non_blanks | Match all not blank cell in the list. |
show_all | Unhide all rows. |
Example
from aspose.cells import Workbook
# Creating a file stream containing the Excel file to be opened
# Instantiating a Workbook object
workbook = Workbook("template.xlsx")
# Accessing the first worksheet in the Excel file
worksheet = workbook.worksheets[0]
# Creating AutoFilter by giving the cells range of the heading row
worksheet.auto_filter.range = "A1:B1"
# Filtering columns with specified values
worksheet.auto_filter.filter(1, "Bananas")
# Saving the modified Excel file.
workbook.save("output.xls")
See Also
- module
aspose.cells
- class
CellArea