EssOtlGetLevelNames

Description

EssOtlGetLevelNames() retrieves all level names specified for a particular dimension.

Syntax

ESS_FUNC_M EssOtlGetLevelNames (hOutline, pszDimension, ulOptions, pulCount, pNameArray);
ESS_HOUTLINE_T hOutline
ESS_STR_T pszDimension
ESS_ULONG_T ulOptions
ESS_PULONG_T pulCount
ESS_PPGENLEVELNAME_T pNameArray

Parameters

hOutlineEssbase outline handle.
pszDimensionThe dimension to retrieve level names for.
ulOptionsThis can be one of the following values:
ESS_GENLEV_ALL - return default and actual level names
ESS_GENLEV_ACTUAL - return only level names that are actually defined
ESS_GENLEV_DEFAULT - return all default level names. This includes the default names for levels that have an actual name.
ESS_GENLEV_NOACTUAL - return default level names. This includes only the levels that don't have an actual level name.
pulCountReturn of the number of elements in the pNameArray. It is the number of level names for the specified member.
pNameArrayAn array of level name structures for the specified dimension.

Return Value

The return value is zero if the function was successful.

Notes

Example

#include <essapi.h>
#include <essotl.h>

ESS_STS_T          sts = ESS_STS_NOERR; 
ESS_HOUTLINE_T     hOutline; 
ESS_OBJDEF_T       Object;
ESS_STR_T          Dimension;
ESS_ULONG_T        LevOpt;
ESS_ULONG_T        pCount = 0, i;
ESS_PGENLEVELNAME_T pNameArray = ESS_NULL;
ESS_ACCESS_T       Access;
ESS_STR_T          AppName;
ESS_STR_T          DbName;

AppName = "Sample";
DbName = "Basic";

sts=EssSetActive(hCtx, AppName, DbName, &Access);

if (sts == 0)
{
   memset(&Object, '\0', sizeof(Object)); 

   sts = EssOtlOpenOutlineQuery(hCtx, &Object, &hOutline); 

   Dimension = "Year";
   LevOpt = ESS_GENLEV_ALL;

   if (!sts)
   {
      sts = EssOtlGetLevelNames(hOutline, Dimension,
            LevOpt, &Count, &pNameArray);

      if(!sts && Count )
      {
         for(i = 0; i<Count; i++)
         {
            printf("\nNumber %ld, Name %s ", 
            pNameArray[i].usNumber, pNameArray[i].szName);
         }
         EssFree(hInst, pNameArray);
      }
   }
}

See Also

EssFree()
EssOtlGetGenName()
EssOtlGetGenNames()
EssOtlGetLevelName()
EssOtlOpenOutline()
EssOtlOpenOutlineQuery()