# EsbOtlGetLevelNames

Description

EsbOtlGetLevelNames() retrieves all level names specified for a particular dimension. Level names are explicitly added to the outline with EsbOtlSetLevelName().

Syntax

    EsbOtlGetLevelNames (hOutline, pszDimension, ulOptions, pulCount)

    ByVal hOutline     As Long
    ByVal pszDimension As String
    ByVal ulOptions    As Long
          pulCount     As Long

Parameters

hOutline | Esbbase outline handle.
pszDimension | The dimension to retrieve level names for.
ulOptions | This can be one of the following values: ESB_GENLEV_ALL - return default and actual level names ESB_GENLEV_ACTUAL - return only level names that are actually defined ESB_GENLEV_DEFAULT - return all default level names. This includes the default names for levels that have an actual name. ESB_GENLEV_NOACTUAL - return default level names. This includes only the levels that don't have an actual level name.
pulCount | Return of the number of elements in the pNameArray. It is the number of level names for the specified member.
pulCount | An array of level name structures for the specified dimension.

Return Value

The return value is zero if the function was successful.

Notes

- The caller should free the pNameArray structure after use by calling EsbFree().
- The programmer should call EsbGetNextItem() once for each level name structure returned.
- This call will work for both EsbOtlOpenOutline() and EsbOtlOpenOutlineQuery(). The information exists locally for both, since it is returned from the server during the EsbOtlOpenOutlineQuery() call.

Example

    Declare Function EsbOtlGetLevelNames Lib "ESBOTLW"
    (ByVal hOutline As Long, ByVal pszDimension As String, ByVal ulOptions
    As Long, pulCount As Long) As Long

    Sub ESB_OtlGetLevelNames()
       Dim sts As Long
       Dim hOutline As Long
       Dim Object As ESB_OBJDEF_T
       Dim Dimension As String
       Dim LevOpt As Long
       Dim Count As Long
       Dim pLevName As ESB_GENLEVELNAME_T
       Dim Access As Integer
       Dim AppName As String
       Dim DbName As String

       AppName = "Sample"
       DbName = "Basic"

       sts = EsbSetActive(hCtx, AppName, DbName, Access)
       If sts = 0 Then
       sts = EsbOtlOpenOutlineQuery(hCtx, Object, hOutline)

       '************** Get Level Names ******************
       Dimension = "Year"
       LevOtp = ESB_GENLEV_DEFAULT
       If sts = 0 Then
         sts = EsbOtlGetLevelNames(hOutline, Dimension,
                LevOpt, Count)
          If sts = 0 And pCount <> 0 Then
            For n = 1 To Count
             sts = EsbGetNextItem(hCtx, ESB_GENLEVELNAME_TYPE, pLevName)
                Next
           End If
         End If
       End If
    End Sub

See Also

EsbFree() (in the main API)
EsbGetNextItem() (in the main API)
EsbOtlGetGenName()
EsbOtlGetGenNames()
EsbOtlGetLevelName()
EsbOtlOpenOutline()
EsbOtlOpenOutlineQuery()