Example:
//Instantiating a Workbook object
$workbook = new cells\Workbook("Book1.xls");
//Accessing the first worksheet in the Excel file
$worksheet = $workbook->getWorksheets()->get(0);
//Creating AutoFilter by giving the cells range of the heading row
$worksheet->getAutoFilter()->setRange("A1:B1");
//Filtering columns with specified values
$worksheet->getAutoFilter()->filter(1, "Bananas");
| Property Getters/Setters Summary | ||
|---|---|---|
function | getFilterColumns() | |
Gets the collection of the filter columns.
|
||
function | getRange() | |
function | setRange(value) | |
| Represents the range to which the specified AutoFilter applies. | ||
function | getShowFilterButton() | |
function | setShowFilterButton(value) | |
| Indicates whether the AutoFilter button for this column is visible. | ||
function | getSorter() | |
Gets the data sorter.
|
||
| Method Summary | ||
|---|---|---|
function | addDateFilter(fieldIndex, dateTimeGroupingType, year, month, day, hour, minute, second) | |
Adds a date filter.
|
||
function | addFillColorFilter(fieldIndex, pattern, foregroundColor, backgroundColor) | |
Adds a fill color filter.
|
||
function | addFilter(fieldIndex, criteria) | |
Adds a filter for a filter column.
|
||
function | addFontColorFilter(fieldIndex, color) | |
Adds a font color filter.
|
||
function | addIconFilter(fieldIndex, iconSetType, iconId) | |
Adds an icon filter.
|
||
function | custom(fieldIndex, operatorType1, criteria1) | |
Filters a list with a custom criteria.
|
||
function | custom(fieldIndex, operatorType1, criteria1, isAnd, operatorType2, criteria2) | |
Filters a list with custom criteria.
|
||
function | dynamicFilter(fieldIndex, dynamicFilterType) | |
Adds a dynamic filter.
|
||
function | filter(fieldIndex, criteria) | |
Filters a list with specified criteria.
|
||
function | filterTop10(fieldIndex, isTop, isPercent, itemCount) | |
Filter the top 10 item in the list
|
||
function | getCellArea() | |
Gets the |
||
function | matchBlanks(fieldIndex) | |
Match all blank cell in the list.
|
||
function | matchNonBlanks(fieldIndex) | |
Match all not blank cell in the list.
|
||
function | refresh() | |
Refresh auto filters to hide or unhide the rows.
|
||
function | refresh(hideRows) | |
Gets all hidden rows' indexes.
|
||
function | removeDateFilter(fieldIndex, dateTimeGroupingType, year, month, day, hour, minute, second) | |
Removes a date filter.
|
||
function | removeFilter(fieldIndex) | |
Remove the specific filter.
|
||
function | removeFilter(fieldIndex, criteria) | |
Removes a filter for a filter column.
|
||
function | setRange(row, startColumn, endColumn) | |
Sets the range to which the specified AutoFilter applies.
|
||
function | showAll() | |
Unhide all rows.
|
||
function getSorter()
function getRange() / function setRange(value)
function getShowFilterButton() / function setShowFilterButton(value)
function getFilterColumns()
function setRange(row, startColumn, endColumn)
row: Number - Row index.startColumn: Number - Start column index.endColumn: Number - End column Index.function getCellArea()
function addFilter(fieldIndex, criteria)
fieldIndex: Number - The 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).
criteria: String - The specified criteria (a string; for example, "101").
It only can be null or be one of the cells' value in this column.
function addDateFilter(fieldIndex, dateTimeGroupingType, year, month, day, hour, minute, second)
fieldIndex: Number - The 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).
dateTimeGroupingType: Number - A year: Number - The year.month: Number - The month.day: Number - The day.hour: Number - The hour.minute: Number - The minute.second: Number - The second.function removeDateFilter(fieldIndex, dateTimeGroupingType, year, month, day, hour, minute, second)
fieldIndex: Number - The 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).
dateTimeGroupingType: Number - A year: Number - The year.month: Number - The month.day: Number - The day.hour: Number - The hour.minute: Number - The minute.second: Number - The second.function removeFilter(fieldIndex, criteria)
fieldIndex: Number - The 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).
criteria: String - The specified criteria (a string; for example, "101").
It only can be null or be one of the cells' value in this column.
function filter(fieldIndex, criteria)
fieldIndex: Number - The 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).
criteria: String - The specified criteria (a string; for example, "101"). function filterTop10(fieldIndex, isTop, isPercent, itemCount)
fieldIndex: Number - The 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).isTop: boolean - Indicates whether filter from top or bottomisPercent: boolean - Indicates whether the items is percent or count itemCount: Number - The item countfunction dynamicFilter(fieldIndex, dynamicFilterType)
fieldIndex: Number - The 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).dynamicFilterType: Number - A function addFontColorFilter(fieldIndex, color)
fieldIndex: Number - The 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).color: CellsColor - The function addFillColorFilter(fieldIndex, pattern, foregroundColor, backgroundColor)
fieldIndex: Number - The 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).pattern: Number - A foregroundColor: CellsColor - The foreground color.backgroundColor: CellsColor - The background color.function addIconFilter(fieldIndex, iconSetType, iconId)
fieldIndex: Number - The 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).iconSetType: Number - A iconId: Number - The icon id.function matchBlanks(fieldIndex)
fieldIndex: Number - The 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).function matchNonBlanks(fieldIndex)
fieldIndex: Number - The 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).function custom(fieldIndex, operatorType1, criteria1)
fieldIndex: Number - The 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).operatorType1: Number - A criteria1: Object - The custom criteriafunction custom(fieldIndex, operatorType1, criteria1, isAnd, operatorType2, criteria2)
fieldIndex: Number - The 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).operatorType1: Number - A criteria1: Object - The custom criteriaisAnd: boolean - operatorType2: Number - A criteria2: Object - The custom criteriafunction showAll()
function removeFilter(fieldIndex)
fieldIndex: Number - The specific filter indexfunction refresh()
function refresh(hideRows)
hideRows: boolean -
If true, hide the filtered rows.