EssOtlGetLevelNames

Retrieves all level names specified for a particular dimension.

Syntax

ESS_FUNC_M EssOtlGetLevelNames (hOutline, pszDimension, ulOptions, pulCount, pNameArray);
ParameterData TypeDescription

hOutline

ESS_HOUTLINE_T

Essbase outline handle.

pszDimension

ESS_STR_T

The dimension to retrieve level names for.

ulOptions

ESS_ULONG_T

This can be one of the following values:

  • ESS_GENLEV_ALL—Returns default and actual level names

  • ESS_GENLEV_ACTUAL—Returns only level names that are actually defined

  • ESS_GENLEV_DEFAULT—Returns all default level names. This includes the default names for levels that have an actual name.

  • ESS_GENLEV_NOACTUAL—Returns default level names. This includes only the levels that don't have an actual level name.

pulCount

ESS_PULONG_T

Return of the number of elements in the pNameArray. It is the number of level names for the specified member.

pNameArray

ESS_GENLEVELNAME_T

An array of level name structures for the specified dimension.

Notes

Return Value

The return value is zero if the function was successful.

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