EssSetCalcList

Description

EssSetCalcList() sets the list of calc scripts objects which are accessible to a user.

Syntax

ESS_FUNC_M  EssSetCalcList (hCtx, UserName, AppName, DbName, AllCalcs, Count, pCalcList); 
ESS_HCTX_ThCtx
ESS_STR_TUserName
ESS_STR_TAppName
ESS_STR_TDbName
ESS_BOOL_TAllCalcs
ESS_USHORT_TCount
ESS_POBJNAME_TpCalcList

Parameters

hCtxEssbase API context handle
UserNameUser name
AppNameApplication name
DbNameDatabase name. If NULL, uses Application subdirectory
AllCalcsAllow all calcs flag. If TRUE, the user can access all calc scripts, otherwise, they can only access those specified in the CalcList argument.
CountCount of the number of accessible calc script objects
pCalcListPointer to an array of calc script object names

Return Value

None.

Notes

Access

This function requires the caller to have database Design privilege (ESS_PRIV_DBDESIGN) for the specified database.

Example

ESS_FUNC_M 
ESS_SetCalcList (ESS_HCTX_T  hCtx)
{
   ESS_FUNC_M       sts = ESS_STS_NOERR;
   ESS_STR_T       UserName;
   ESS_STR_T       AppName;   
   ESS_STR_T       DbName;
   ESS_BOOL_T      AllCalcs;
   ESS_USHORT_T    Count;            
   ESS_OBJNAME_T   pCalcList[3];
   
   UserName = "Newuser";
   AppName  = "Sample";
   DbName   = "Basic";
   AllCalcs = ESS_FALSE ;
   Count = 3;
   strcpy(pCalcList[0],"test1");
   strcpy(pCalcList[1],"test2");
   strcpy(pCalcList[2],"test3");
   
   sts = EssSetCalcList(hCtx, UserName, AppName,
         DbName, AllCalcs, Count, pCalcList);
   
   return (sts);
}

See Also

EssGetCalcList()
EssListObjects()
EssListUsers()