Sets the name for a specific generation within a dimension.
Syntax
ESS_FUNC_M EssOtlSetGenName (hOutline, pszDimension, usGen, pszName);
| Parameter | Data Type | Description |
|---|---|---|
hOutline | ESS_HOUTLINE_T | Outline context handle. |
pszDimension | ESS_STR_T | Name of dimension that contains the generation. |
usGen | ESS_USHORT_T | Number of generation for which to set a name. The dimension itself is generation 1. |
pszName | ESS_STR_T | Name to give the generation. |
Notes
The generation name 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 generation name generates an error.
Each specific dimension and generation must have only one name.
Return Value
Returns 0 if successful; otherwise one of the following:
OTLAPI_BAD_GENLEVELNAME
OTLAPI_ERR_GENLEVELNAMEEXISTS
OTLAPI_ERR_GENLEVELEXISTS
OTLAPI_ERR_GENLEVELVALUE
OTLAPI_ERR_NOTADIM
OTLAPI_ ERR_GENLEVELNAMEMBR
Example
#include <essapi.h>
#include <essotl.h>
ESS_STS_T sts = 0;
ESS_HOUTLINE_T hOutline;
ESS_OBJDEF_T Object;
ESS_APPNAME_T szAppName;
ESS_DBNAME_T szDbName;
ESS_OBJNAME_T szFileName;
ESS_STR_T Dimension;
ESS_USHORT_T GenNum;
ESS_STR_T GenName;
memset(&Object, '\0', sizeof(Object));
Object.hCtx = hCtx;
Object.ObjType = ESS_OBJTYPE_OUTLINE;
strcpy(szAppName, "Sample");
strcpy(szDbName, "Basic");
strcpy(szFileName, "Basic");
Object.AppName = szAppName;
Object.DbName = szDbName;
Object.FileName = szFileName;
sts = EssOtlOpenOutline(hCtx, &Object, ESS_TRUE,
ESS_TRUE, &hOutline);
/************ Set Generation Name ************/
Dimension = "Year";
GenNum = 2;
GenName = "Qtr123";
if (!sts)
{
sts = EssOtlSetGenName(hOutline, Dimension,
GenNum, GenName);
}See Also