# EsbOtlGetLevelName

Description

EsbOtlGetLevelName() gets the name for a specific level within a dimension. Level names are explicitly added to the outline with EsbOtlSetLevelName().

Syntax

    EsbOtlGetLevelName (hOutline, pszDimension, usLevel, pszName)

    ByVal hOutline     As Long
    ByVal pszDimension As String
    ByVal usLevel      As Integer
    ByVal pszName      As String

Parameters

hOutline | Outline context handle.
pszDimension | Name of dimension that contains the generation.
usLevel | Number of level number for which to get a name. Leaf members are level 0.
pszName | Buffer for return of the level of the specified dimension, allocated by the caller. The buffer must be large enough to hold a valid member name (ESB_MBRNAMELEN).

Return Value

The return value is zero if the function was successful. Otherwise, the command returns either of the following:

OTLAPI_NO_GENLEVELNAME
OTLAPI_ERR_NOTADIM

Notes

- The generation name follows the same rules as a member name and must be unique across the entire member name space. It cannot duplicate any other generation, level, member name, or alias. Attempting to add a duplicate name generates an error.
- Level names are not automatically assigned. For this function to return the name, a name must have been assigned. The name can be assigned with EsbOtlSetLevelName().

Example

    Declare Function EsbOtlGetLevelName Lib
    "ESBOTLW" (ByVal hOutline As Long, ByVal pszDimension
    As String, ByVal usLevel As Integer, ByVal pszName
    As String) As Long

    Sub ESB_OtlGetLevelName()
    Dim sts As Long
    Dim Object As ESB_OBJDEF_T
    Dim hOutline As Long
    Dim Dimension As String
    Dim LevelNum As Integer
    Dim LevelName As String * ESB_MBRNAMELEN

    Object.hCtx = hCtx
    Object.Type = ESB_OBJTYPE_OUTLINE
    Object.AppName = "Sample"
    Object.DbName = "Basic"
    Object.FileName = "Basic"

    sts = EsbOtlOpenOutline(hCtx, Object, ESB_YES,
    ESB_YES, hOutline)

    '*****************************************
    '********** Get Level Name ***************
    '*****************************************
    Dimension = "Year"
    LevelNum = 2
    If Not sts Then
       sts = EsbOtlGetLevelName(hOutline,
        Dimension, LevelNum, LevelName)
    End If
    End Sub

See Also

EsbOtlGetLevelNames()
EsbOtlDeleteLevelName()
EsbOtlSetLevelName()