public interface AutoFilter
Filtering data is a quick and easy way to find and work with a subset of data in a range of cells or table. For example, you can filter to see only the values that you specify, filter to see the top or bottom values, or filter to quickly see duplicate values.
TODO YK: For now (Aug 2010) POI only supports setting a basic autofilter on a range of cells. In future, when we support more auto-filter functions like custom criteria, sort, etc. we will add corresponding methods to this interface.Modifier and Type | Method and Description |
---|---|
FilterColumn |
getFilterColumn(int col)
Returns the column filter information of the specified column; null if the column is not filtered.
|
List<FilterColumn> |
getFilterColumns()
Return filter setting of each filtered column.
|
CellRangeAddress |
getRangeAddress()
Returns the filtered Range.
|
static final int FILTEROP_AND
Example:
AutoFilter filter = sheet.setAutoFilter(CellRangeAddress.valueOf("A1:F200")); filter.applyFilter(0, "apache", "poi", "java", "api");
static final int FILTEROP_BOTTOM10
static final int FILTEROP_BOTOOM10PERCENT
static final int FILTEROP_OR
static final int FILTEROP_TOP10
static final int FILTEROP_TOP10PERCENT
static final int FILTEROP_VALUES
static final int FILTEROP_CELL_COLOR
static final int FILTEROP_FONT_COLOR
static final int FILTEROP_ABOVE_AVERAGE
static final int FILTEROP_BELOW_AVERAGE
static final int FILTEROP_TOMORROW
static final int FILTEROP_TODAY
static final int FILTEROP_YESTERDAY
static final int FILTEROP_NEXT_WEEK
static final int FILTEROP_THIS_WEEK
static final int FILTEROP_LAST_WEEK
static final int FILTEROP_NEXT_MONTH
static final int FILTEROP_THIS_MONTH
static final int FILTEROP_LAST_MONTH
static final int FILTEROP_NEXT_QUARTER
static final int FILTEROP_THIS_QUARTER
static final int FILTEROP_LAST_QUARTER
static final int FILTEROP_NEXT_YEAR
static final int FILTEROP_THIS_YEAR
static final int FILTEROP_LAST_YEAR
static final int FILTEROP_YEAR_TO_DATE
static final int FILTEROP_Q1
static final int FILTEROP_Q2
static final int FILTEROP_Q3
static final int FILTEROP_Q4
static final int FILTEROP_M1
static final int FILTEROP_M2
static final int FILTEROP_M3
static final int FILTEROP_M4
static final int FILTEROP_M5
static final int FILTEROP_M6
static final int FILTEROP_M7
static final int FILTEROP_M8
static final int FILTEROP_M9
static final int FILTEROP_M10
static final int FILTEROP_M11
static final int FILTEROP_M12
CellRangeAddress getRangeAddress()
List<FilterColumn> getFilterColumns()
FilterColumn getFilterColumn(int col)
col
- the nth column (1st column in the filter range is 0)Copyright © 2023. All rights reserved.