FilterColumn class reference

  • int index() const
    Returns the zero-based index of this AutoFilter column.
  • Filter filterType() const
    Returns the filter type of this AutoFilter column.
    Filter valueDescription
    FILTER_VALUEFilter by specified values.
    FILTER_TOP10The top N (percent or number of items) to filter by.
    FILTER_CUSTOMCustom filter with specified criteria.
    FILTER_DYNAMICSpecifies dynamic filter criteria.
    FILTER_COLORSpecifies the color to filter by.
    FILTER_ICONSpecifies the icon to filter by.
    FILTER_EXTDefines flexible storage extensions.
    FILTER_NOT_SETNo filter.
  • int filterSize() const
    Returns the number of filter values.
  • const wchar_t* filter(int index) const
    Returns the filter value by index.
  • void addFilter(const wchar_t* value)
    Adds the filter value. See the example.
  • bool getTop10(double* value, bool* top, bool* percent)
    Gets the number of top or bottom items:
    value - number of items;
    top - top items if true otherwise bottom items;
    percent - using percent instead of number items.
    Returns false if error. Get error info with Book::errorMessage().
  • void setTop10(double value, bool top = true, bool percent = false)
    Sets the number of top or bottom items:
    value - number of items;
    top - top items if true otherwise bottom items;
    percent - using percent instead of number items.
    See the example.
  • bool getCustomFilter(Operator* op1, const wchar_t** v1, Operator* op2, const wchar_t** v2, bool* andOp)
    Gets the custom filter criteria:
    op1 - operator used by the filter comparison in the first filter criteria;
    v1 - value used in the first filter criteria;
    op2 - operator used by the filter comparison in the second filter criteria;
    v2 - value used in the second filter criteria;
    andOp - flag indicating whether the two criterias have an "and" relationship. True indicates "and", false indicates "or".
    Returns false if error. Get error info with Book::errorMessage().
  • void setCustomFilter(Operator op1, const wchar_t* v1, Operator op2 = OPERATOR_EQUAL, const wchar_t* v2 = 0, bool andOp = false)
    Sets the custom filter criteria:
    op1 - operator used by the filter comparison in the first filter criteria;
    v1 - value used in the first filter criteria;
    op2 - operator used by the filter comparison in the second filter criteria;
    v2 - value used in the second filter criteria;
    andOp - flag indicating whether the two criterias have an "and" relationship. True indicates "and", false indicates "or". See the examples here and here.
    Operator valueDescription
    OPERATOR_EQUAL=
    OPERATOR_GREATER_THAN>
    OPERATOR_GREATER_THAN_OR_EQUAL>=
    OPERATOR_LESS_THAN<
    OPERATOR_LESS_THAN_OR_EQUAL<=
    OPERATOR_NOT_EQUAL<>
  • void clear()
    Clear the filter criteria.