EssGetCalcList

Description

EssGetCalcList() gets the list of calc scripts objects which are accessible to a user.

Syntax
ESS_FUNC_M EssGetCalcList (hCtx, UserName, AppName, DbName, pAllCalcs, pCount, ppCalcList);
ESS_HCTX_ThCtx
ESS_STR_TUserName
ESS_STR_TAppName
ESS_STR_TDbName
ESS_PBOOL_TpAllCalcs
ESS_PUSHORT_TpCount
ESS_PPOBJNAME_TppCalcList

Parameters

hCtxEssbase API context handle
UserNameUser name
AppNameApplication name
DbNameDatabase name
pAllCalcsAddress of a variable to receive the allow all calcs flag. If TRUE, the user can access all calc scripts, otherwise, they can only access those specified in the CalcList argument.
pCountAddress of variable to receive a count of the number of accessible calc script objects
ppCalcListAddress of a pointer to receive an allocated array of calc script object names

Return Value

If successful, the user's allow all calcs setting is returned in pAllCalcs, a count of their accessible calc scripts objects is returned in pCount, and a list of calc script object names is returned in ppCalcList.

Notes

Access

This function requires the caller to have database Design privilege (ESS_PRIV_DBDESIGN) for the specified database, unless they are getting their own calc list.

Example

ESS_FUNC_M 
ESS_GetCalcList (ESS_HCTX_T  hCtx, ESS_HINST_T hInst)
{                          
   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, ind;            
   ESS_POBJNAME_T  pCalcList = NULL;
   
   UserName = "Admin";
   AppName  = "Sample";
   DbName   = "Basic";
   sts = EssGetCalcList(hCtx, UserName, AppName, 
         DbName, &AllCalcs, &Count, &pCalcList);
   if(!sts && pCalcList)
   {
printf("-------- Get Calc List -----------\r\n"); 
      for (ind = 0; ind < Count; ind ++)
         printf(" %s\r\n",pCalcList[ind]);
      
      EssFree(hInst, pCalcList);
   }
   
   return (sts);
}

See Also

EssListObjects()
EssListUsers()
EssSetCalcList()