Retrieves the name for a specific generation within a dimension. Generation names are explicitly added to the outline with EsbOtlSetGenName.
Syntax
EsbOtlGetGenName (hOutline, pszDimension, usGen, pszName) ByVal hOutline As Long ByVal pszDimension As String ByVal usGen As Integer ByVal pszName As String
| Parameter | Description |
|---|---|
hOutline | Outline context handle. |
pszDimension | Name of dimension that contains the generation name. |
usGen | Number of generation for which to get a name. The dimension is generation 1. |
ppszName | Buffer for return of generation name, allocated by the caller. The buffer must be large enough to hold a valid member name (ESB_MBRNAMELEN). |
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.
Generation names are not automatically assigned. For this function to return the name, a name must have been assigned. The name can be assigned with EsbOtlSetGenName
Return Value
Returns 0 if successful; otherwise:
OTLAPI_NO_GENLEVELNAME
OTLAPI_ERR_NOTADIM
Example
Declare Function EsbOtlGetGenName Lib
"ESBOTLN" (ByVal hOutline As Long, ByVal pszDimension
As String, ByVal usGen As Integer, ByVal pszName
As String) As Long
Sub ESB_OtlGetGenName()
Dim sts As Long
Dim Object As ESB_OBJDEF_T
Dim hOutline As Long
Dim Dimension As String
Dim GenNum As Integer
Dim GenName 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 Gen Name ******************
'**********************************************
Dimension = "Year"
GenNum = 2
If Not sts Then
sts = EsbOtlGetGenName(hOutline, Dimension,
GenNum, GenName)
End If
End SubSee Also