Creates a new filter and starts setting its contents.
Syntax
ESS_FUNC_M EssCreateFilter (hCtx, AppName, DbName, FilterName, Active, Access);
Parameter | Data Type | Description |
---|---|---|
hCtx | ESS_HCTX_T | API context handle |
AppName | ESS_STR_T | Application name |
DbName | ESS_STR_T | Database name |
FilterName | ESS_STR_T | Filter name. See Filter Name Limits. |
Active | ESS_BOOL_T | Filter active flag. If TRUE, the filter is set active, otherwise it is set inactive. |
Access | ESS_ACCESS_T | The default filter access level |
Notes
If the filter does not already exist, it will be created by this call.
If the filter already exists, an error message is returned.
This call must be followed by successive calls to EssSetFilterRow() to set all the rows for the filter.
Return Value
None.
Access
This function requires the caller to have database designer permission (ESS_PRIV_DBDESIGN) for the specified database.
Example
ESS_FUNC_M ESS_CreateFilter (ESS_HCTX_T hCtx) { ESS_FUNC_M sts = ESS_STS_NOERR; ESS_STR_T AppName; ESS_STR_T DbName; ESS_STR_T FilterName; ESS_BOOL_T Active; ESS_ACCESS_T Access, AccessAry[3]; ESS_STR_T RowString[3]; ESS_USHORT_T ind; AppName = "Sample"; DbName = "Basic"; FilterName = "NewFilter"; Active = ESS_TRUE; /***** Create Filter *****/ sts = EssCreateFilter(hCtx, AppName, DbName, FilterName, Active, Access); if(!sts) { RowString[0] = "@IDESCENDANTS(Scenario)"; RowString[1] = "@IDESCENDANTS(Product)"; RowString[2] = "Qtr1, @IDESCENDANTS(\"Colas\")"; AccessAry[0] = ESS_ACCESS_READ; AccessAry[1] = ESS_ACCESS_NONE; AccessAry[2] = ESS_ACCESS_WRITE; /***** Set Filter Rows *****/ for(ind = 0; ind < 3; ind++) { sts = EssSetFilterRow(hCtx, RowString[ind], AccessAry[ind]); if(sts) printf("Cannot set Filter row %s\r\n", RowString[ind]); } sts = EssSetFilterRow(hCtx, "",ESS_ACCESS_NONE); } return (sts); }
See Also