2.2.4.5.14 Column::GetFilter


Version

Minimum Origin Version Required: Origin 2016 SR0

Description

Get data filter of one column.

Syntax

BOOL GetFilter( int & nType, const LPVOID * data )

Parameters

nType
[output]the column filter type enum
{
COLUMN_FILTER_TYPE_NONE = -1,
COLUMN_FILTER_TYPE_CHECK_LIST = 0,
COLUMN_FILTER_TYPE_CUSTOM,
COLUMN_FILTER_TYPE_COMMAND,
COLUMN_FILTER_TYPE_DATASET_FUNC,
};
data
[output]struct with filter settings. Each filter type has its own struct. See Column::SetFilter for detail.

Return

TRUE if success

Examples

EX1

void Column_GetFilter_ex()
{
    Worksheet wks;
    if( wks.Create("origin") )
    {
        Dataset ds(wks, 0);
        ds.Data(1, 10);
    }
    
    CommandColumnFilterData mydata;
    mydata.lpcszCommand = "col <= 2 or col > 6";
    
    Column col(wks, 0);
    col.SetFilter((int)COLUMN_FILTER_TYPE_COMMAND, (LPVOID)&mydata);
    col.SetFilterThisCol("col");
    
    LPVOID data;
    int nType;
    col.GetFilter(nType, &data) ;
    if(COLUMN_FILTER_TYPE_COMMAND == nType)
    {
        CommandColumnFilterData* pdata = (CommandColumnFilterData*)data;
        out_str(pdata->lpcszCommand);
    }
}

Remark

See Also

Worksheet::RunFilter, Column::SetFilter, Column::ResetFilter

Header to Included

origin.h