# EssOtlGetAttributeInfo

Description

This function returns attribute information for a given attribute member or dimension.

Syntax

ESS_FUNC_M EssOtlGetAttributeInfo (hOutline, hAttribute, pAttributeInfo);

ESS_HOUTLINE_T | hOutline;
ESS_HMEMBER_T | hAttribute;
ESS_PATTRIBUTEINFO_T | pAttributeInfo;

Parameters

hOutline | Handle to the outline
hAttribue | Handle to the attribute member or dimension
pAttributeInfo | Attribute information

Return Value

Notes

- This function is similar to EssGetAttributeInfo().
- After you call this function, call EssOtlFreeStructure() to free memory dynamically allocated by EssOtlGetAttributeInfo() for string type attribute information.

Access

Example

    void ESS_GetAttributeInfo()
    {
       ESS_PATTRIBUTEINFO_T    pAttributeInfo = ESS_NULL;
       ESS_STS_T        sts = ESS_STS_NOERR;
       ESS_OBJDEF_T      Object;
       ESS_APPNAME_T      szAppName;
       ESS_DBNAME_T      szDbName;
       ESS_OBJNAME_T      szFileName;
       ESS_HOUTLINE_T       hOutline;
       ESS_PPHMEMBER_T      phMember;
       ESS_PPMBRINFO_T      phMemberInfo;
       ESS_MBRNAME_T      mbrName;
       ESS_HMEMBER_T      hMember;

       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);
       printf("EssOtlOpenOutline() sts: %ld\n",sts);

       sts = EssOtlFindMember(hOutline, "100-10", &hmember);
       printf("EssOtlFindMember() sts: %ld\n",sts);

       sts = EssOtlGetAttributeInfo(hOutline, hMember, &pAttributeInfo);
       if (sts == ESS_STS_NOERR && pAttributeInfo)
       {
          printf("\n------Attribute Information------\n");
          printf("Member name:                %s\n", pAttributeInfo->MbrName);
          printf("Dim name:                   %s\n", pAttributeInfo->DimName);

          switch(pAttributeInfo->Attribute.usDataType)
          {
             case (ESS_ATTRMBRDT_STRING):
                printf("Attribute data type:        Text\n");
                if(pAttributeInfo->Attribute.value.strData)
                printf("Attribute value:            %s\n",pAttributeInfo->Attribute.value.strData);
                break;

             case (ESS_ATTRMBRDT_BOOL):
                printf("Attribute data type:        Boolean\n");
                printf("Attribute value:            %d\n",pAttributeInfo->Attribute.value.bData);
                break;

             case (ESS_ATTRMBRDT_DOUBLE):
                printf("Attribute data type:        Numeric\n");
                printf("Attribute value:            %f\n",pAttributeInfo->Attribute.value.dblData);
                break;

             case (ESS_ATTRMBRDT_DATETIME):
                printf("Attribute data type:        Date\n");
                printf("Attribute value:            %s\n",ctime(&pAttributeInfo->Attribute.value.dtData));
                break;

             case (ESS_ATTRMBRDT_NONE):
                printf("Attribute data type:        None\n");
                break;

             default:
                printf("Attribute data type:        \n");
                break;
          }
       }
    }

See Also

EssCheckAttributes()
EssFreeStructure()
EssGetAssociatedAttributesInfo()
EssGetAttributeInfo()
EssGetAttributeSpecifications()
EssOtlAssociateAttributeDimension()
EssOtlAssociateAttributeMember()
EssOtlDisassociateAttributeDimension()
EssOtlDisassociateAttributeMember()
EssOtlFindAttributeMembers()
EssOtlFreeStructure()
EssOtlGetAssociatedAttributes()
EssOtlGetAttributeSpecifications()
EssOtlQueryAttributes()
EssOtlSetAttributeSpecifications()