# EssOtlSetMemberInfo

Description

EssOtlSetMemberInfo() sets member attribute information.

Syntax

    ESS_FUNC_M EssOtlSetMemberInfo (hOutline, hMember, pInfo);

ESS_HOUTLINE_T | hOutline
ESS_HMEMBER_T | hMember
ESS_PMBRINFO_T | pInfo

Parameters

hOutline | Outline context handle
hMember | Handle to member to set attributes for
pinfo | Member information structure

Return Value

Returns 0 if successful; otherwise one of the following:

OTLAPI_BAD_CONSOL
OTLAPI_BAD_MBRNAME
OTLAPI_BAD_MEMBER
OTLAPI_ERR_ADDNAMEUSED
OTLAPI_ERR_CURTOOMANYDIMS
OTLAPI_ERR_BADSHARE
OTLAPI_ERR_BADSKIP
OTLAPI_ERR_BADSTORAGE
OTLAPI_ERR_BADSTORAGECATEGORY
OTLAPI_ERR_BADTIMEBAL
OTLAPI_ERR_ILLEGALBOOLEAN
OTLAPI_ERR_ILLEGALCURRENCY
OTLAPI_ERR_ILLEGALDATE
OTLAPI_ERR_ILLEGALNAME
OTLAPI_ERR_ILLEGALNUMERIC
OTLAPI_ERR_ILLEGALTAG
OTLAPI_ERR_LEAFLABEL
OTLAPI_ERR_NOSHAREPROTO
OTLAPI_ERR_NOTIMEDIM
OTLAPI_ERR_SHARENOTLEVEL0

Notes

- Attributes:
  - Three fields of the ESS_MBRINFO_T structure are for attributes only:

    Data Type | Field | Description
    ESS_BOOL_T | fAttributed | Indicates whether a base member has attributes associated with it: either ESS_TRUE or ESS_FALSE.
    ESS_USHORT_T | Attribute.usDataType | For an attribute dimension or zero-level (leaf node) attribute member, one of the following data types: ESS_ATTRMBRDT_BOOL ESS_ATTRMBRDT_DATETIME ESS_ATTRMBRDT_DOUBLE ESS_ATTRMBRDT_STRING For any attribute member, but not an attribute dimension: ESS_ATTRMBRDT_NONE ESS_ATTRMBRDT_AUTO
    Note: Use ESS_ATTRMBRDT_AUTO only when adding a member. See Notes on Adding an Attribute Member.
    union ESS_BOOL_T ESS_STR_T ESS_DATETIME_T ESS_DOUBLE_T | Attribute.value bData strData dtData dblData | One of the following attribute member values: Boolean value String value Date and time value Double value

  - Values for two fields of the ESS_MBRINFO_T structure are for attributes only:

    Data Type | Field | Description
    ESS_USHORT_T | usCategory | One of the following dimension categories: ESS_CAT_ATTRIBUTE ESS_CAT_ATTRCALC (for internal use only)
    ESS_USHORT_T | usStorageCategory | One of the following dimension storage categories: ESS_STORECAT_ATTRIBUTE ESS_STORECAT_ATTRCALC (for internal use only)

Example

    #include <essapi.h>
    #include <essotl.h>

    ESS_STS_T          sts = 0;
    ESS_HOUTLINE_T     hOutline;
    ESS_HMEMBER_T      hMemberJan;
    ESS_MBRINFO_T      MbrInfo;
    ESS_PMBRINFO_T     pMbrInfo = ESS_NULL;
    ESS_OBJDEF_T       Object;
    ESS_APPNAME_T      szAppName;
    ESS_DBNAME_T       szDbName;
    ESS_OBJNAME_T      szFileName;

    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);

    if (!sts)
    {
       sts = EssOtlFindMember(hOutline, "Jan",
             &hMemberJan);
    }

    if (!sts && hMemberJan)
    {
       sts = EssOtlGetMemberInfo(hOutline,
             hMemberJan, &pMbrInfo);
    }

    if (!sts && pMbrInfo)
    {
       pMbrInfo->usConsolidation = ESS_UCALC_SUB;
       pMbrInfo->fTwoPass = ESS_TRUE;
       pMbrInfo->fExpense = ESS_TRUE;
       sts = EssOtlSetMemberInfo(hOutline,
             hMemberJan, pMbrInfo);
    }

    if (pMbrInfo)
    {
       EssOtlFreeStructure(hOutline, count, structId, structPtr);
    }

See Also

EssGetMemberInfo()
EssOtlFindMember()