Sets the generation name and member uniqueness setting for the specified generation number.
Syntax
ESS_FUNC_M EssOtlSetGenNameEx (hOutline, pszDimension, usGen, pszName, bUniqueName);
Parameter | Data Type | Description |
---|---|---|
hOutline | ESS_HOUTLINE_T | Outline context handle. |
pszDimension | ESS_STR_T | Dimension name. |
usGen | ESS_USHORT_T | The number of the generation for which to set a name. |
pszName | ESS_STR_T | The name to give the generation. |
bUniqueName | ESS_BOOL_T | If TRUE, members at generation usGen in dimension pszDimension cannot have duplicate names. |
Notes
This function sets the name of a generation as well as the uniqueness property of a generation. If you only want to set the name, use EssOtlSetGenName.
If you only want to set the uniqueness property, but not change the name, you must still pass in the name. To do so, call EssOtlGetGenName and pass its value to this function as usGen.
Do not pass null for the usGen parameter.
Return Value
Returns 0 if successful; otherwise, returns an error code.
Example
void ESS_GetGenNameEx() { 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; ESS_BOOL_T bUnique= ESS_FALSE; memset(&Object, '\0', sizeof(Object)); Object.hCtx = hCtx; Object.ObjType = ESS_OBJTYPE_OUTLINE; strcpy(szAppName, "Demo"); strcpy(szDbName, "Test"); strcpy(szFileName, "Test"); Object.AppName = szAppName; Object.DbName = szDbName; Object.FileName = szFileName; sts = EssOtlOpenOutline(hCtx, &Object, ESS_TRUE, ESS_TRUE, &hOutline); printf("EssOtlOpenOutline sts: %ld\n",sts); /*************** Set and Get GenName **************/ Dimension = "Year"; GenNum = 1; GenName = "Gen 1 Year"; //SetGenNameEx() so that Gen 1 members of Year cannot be non-unique if (!sts) { sts = EssOtlSetGenNameEx(hOutline, Dimension, GenNum, GenName, ESS_TRUE); } // GetGenNameEx() to see if the gen is able to be non-unique if (!sts) { sts = EssOtlGetGenNameEx(hOutline, Dimension, GenNum, &GenName, &bUnique); printf("Generation 1 members of Year have bUnique value of %ld\n", bUnique); printf("EssOtlGetGenNameEx sts: %ld\n",sts); } if (!sts && GenName) { printf("Gen Name: %s\n",GenName); EssFree(hInst, GenName); } }
See Also