The XLFilterColumn class encapsulates the <filterColumn> XML node. It allows setting different kinds of filter criteria for a specific column in an AutoFilter range.
More...
#include <XLAutoFilter.hpp>
|
| | XLFilterColumn (XMLNode node) |
| | Constructor.
|
| void | addFilter (const std::string &value) |
| | Add a specific string value to filter by.
|
| void | clearFilters () |
| | Clear all filters for this column.
|
| void | setCustomFilter (const std::string &op, const std::string &val) |
| | Set a single custom filter criteria.
|
| void | setCustomFilter (const std::string &op1, const std::string &val1, XLFilterLogic logic, const std::string &op2, const std::string &val2) |
| | Set a compound custom filter criteria.
|
| void | setTop10 (double value, bool percent=false, bool top=true) |
| | Set a top-10 filter.
|
| void | setDynamicFilter (const std::string &type) |
| | Set a dynamic filter (e.g. "aboveAverage", "today", "Q1").
|
| uint16_t | colId () const |
| | Get the column ID (0-based relative to the AutoFilter range).
|
The XLFilterColumn class encapsulates the <filterColumn> XML node. It allows setting different kinds of filter criteria for a specific column in an AutoFilter range.
◆ XLFilterColumn()
| OpenXLSX::XLFilterColumn::XLFilterColumn |
( |
XMLNode | node | ) |
|
|
explicit |
◆ addFilter()
| void OpenXLSX::XLFilterColumn::addFilter |
( |
const std::string & | value | ) |
|
Add a specific string value to filter by.
- Parameters
-
| value | The value to add to the filter list. |
◆ clearFilters()
| void OpenXLSX::XLFilterColumn::clearFilters |
( |
| ) |
|
Clear all filters for this column.
◆ colId()
| uint16_t OpenXLSX::XLFilterColumn::colId |
( |
| ) |
const |
Get the column ID (0-based relative to the AutoFilter range).
- Returns
- The column ID.
◆ setCustomFilter() [1/2]
| void OpenXLSX::XLFilterColumn::setCustomFilter |
( |
const std::string & | op, |
|
|
const std::string & | val ) |
Set a single custom filter criteria.
- Parameters
-
| op | The operator (e.g., "greaterThan", "lessThan", "equal", "notEqual", "greaterThanOrEqual", "lessThanOrEqual") |
| val | The value to compare against. |
◆ setCustomFilter() [2/2]
| void OpenXLSX::XLFilterColumn::setCustomFilter |
( |
const std::string & | op1, |
|
|
const std::string & | val1, |
|
|
XLFilterLogic | logic, |
|
|
const std::string & | op2, |
|
|
const std::string & | val2 ) |
Set a compound custom filter criteria.
- Parameters
-
| op1 | The first operator. |
| val1 | The first value. |
| logic | The logical operator joining the two conditions (And/Or). |
| op2 | The second operator. |
| val2 | The second value. |
◆ setDynamicFilter()
| void OpenXLSX::XLFilterColumn::setDynamicFilter |
( |
const std::string & | type | ) |
|
Set a dynamic filter (e.g. "aboveAverage", "today", "Q1").
- Parameters
-
| type | The type of dynamic filter. |
◆ setTop10()
| void OpenXLSX::XLFilterColumn::setTop10 |
( |
double | value, |
|
|
bool | percent = false, |
|
|
bool | top = true ) |
Set a top-10 filter.
- Parameters
-
| value | The threshold value. |
| percent | If true, filters by top percentage rather than count. |
| top | If true, filters top values; if false, filters bottom values. |
The documentation for this class was generated from the following files: