# EssOtlGetAttributeSpecifications

Description

EssOtlGetAttributeSpecifications() retrieves attribute specifications for the outline.

Syntax

ESS_FUNC_M EssOtlGetAttributeSpecifications (hOutline, pAttrSpecs);

ESS_HOUTLINE_T | hOutline;
ESS_PPATTRSPECS_T | pAttrSpecs;

Parameters

hOutline | Handle to the outline
pAttrSpecs | Attribute specifications

Return Value

Notes

- This function is similar to EssGetAttributeSpecifications(), except that it returns information from the opened outline.
- Set attribute specifications for the outline using EssOtlSetAttributeSpecifications().
- Attribute specifications are used to do the following:
  - Generate a long name
  - Indicate the format of a datetime attribute
  - Indicate a numeric attribute's bucketing type
  - Provide the name of the attribute calculations dimension and the names for the values used with it

Access

Example

    void  ESS_OtlGetAttributeSpecifications()
    {
       ESS_STS_T         sts = ESS_STS_NOERR;
       ESS_PATTRSPECS_T  AttrSpecs;
        ESS_OBJDEF_T     Object;
        ESS_HOUTLINE_T   hOutline;
        ESS_APPNAME_T    szAppName;
        ESS_DBNAME_T     szDbName;
        ESS_OBJNAME_T    szFileName;
        ESS_PROCSTATE_T  pState;

       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 = EssOtlGetAttributeSpecifications(hOutline,&AttrSpecs);
       printf("EssOtlGetAttributeSpecifications() sts: %ld\n",sts);

       switch(AttrSpecs->usGenNameBy)
       {
          case ESS_GENNAMEBY_PREFIX:
             printf("\n Prefix/Suffix   : Prefix");
             break;
          case ESS_GENNAMEBY_SUFFIX:
             printf("\n Prefix/Suffix   : Suffix");
             break;
          default:
             printf("\n Prefix/Suffix   : None");
             break;
       }
       switch(AttrSpecs->usUseNameOf)
       {
          case ESS_USENAMEOF_PARENT:
             printf("\n Use Name of     : Parent");
             break;
          case ESS_USENAMEOF_GRANDPARENTANDPARENT:
             printf("\n Use Name of     : Grand Parent and Parent");
             break;
          case ESS_USENAMEOF_ALLANCESTORS:
             printf("\n Use Name of     : All Ancestors");
             break;
          case ESS_USENAMEOF_DIMENSION:
             printf("\n Use Name of     : Dimension");
             break;
          case ESS_USENAMEOF_NONE:
             printf("\n Use Name of     : None");
             break;
          default:
             printf("\n Use Name of     : Invalid setting");
             break;
       }
       switch(AttrSpecs->cDelimiter)
       {
          case ESS_DELIMITER_PIPE:
             printf("\n Delimiter       : '|'");
             break;
          case ESS_DELIMITER_UNDERSCORE:
             printf("\n Delimiter       : '_'");
             break;
          case ESS_DELIMITER_CARET:
             printf("\n Delimiter       : '^'");
             break;
          default:
             printf("\n Delimiter       : Invalid setting");
             break;
       }

       switch(AttrSpecs->usDateFormat)
       {
          case ESS_DATEFORMAT_DDMMYYYY :
             printf("\n Date Format     : DD-MM-YYYY");
             break;
          case ESS_DATEFORMAT_MMDDYYYY :
             printf("\n Date Format     : MM-DD-YYYY");
             break;
          default:
             printf("\n Date Format     : Invalid setting");
             break;

       }
       switch(AttrSpecs->usBucketingType)
       {
          case ESS_UPPERBOUNDINCLUSIVE :
             printf("\n Bucketing Type  : Upper Bound inclusive");
             break;
          case ESS_UPPERBOUNDNONINCLUSIVE :
             printf("\n Bucketing Type  : Upper Bound non-inclusive");
             break;
          case ESS_LOWERBOUNDINCLUSIVE :
             printf("\n Bucketing Type  : Lower Bound inclusive");
             break;
          case ESS_LOWERBOUNDNONINCLUSIVE :
             printf("\n Bucketing Type  : Lower Bound non-inclusive");
             break;
          default:
             printf("\n Bucketing Type   : Invalid setting");
             break;
       }

       printf("\n Default for TRUE       : %s",
               AttrSpecs->pszDefaultTrueString);

       printf("\n Default for FALSE      : %s",
               AttrSpecs->pszDefaultFalseString);

       printf("\n Default for Attr Calc  : %s",
               AttrSpecs->pszDefaultAttrCalcDimName);

       printf("\n Default for Sum        : %s",
               AttrSpecs->pszDefaultSumMbrName);

       printf("\n Default for Count      : %s",
               AttrSpecs->pszDefaultCountMbrName);

       printf("\n Default for Average    : %s",
               AttrSpecs->pszDefaultAverageMbrName);

       printf("\n Default for Min        : %s",
               AttrSpecs->pszDefaultMinMbrName);

       printf("\n Default for Max        : %s",
               AttrSpecs->pszDefaultMaxMbrName);

       printf("\n");

       sts = EssOtlWriteOutline(hOutline, &Object);
       printf("EssOtlWriteOutline() sts: %ld\n",sts);

       sts = EssOtlRestructure(hCtx, ESS_DOR_ALLDATA);
       printf("EssOtlRestructure() sts: %ld\n",sts);

       if (!sts)
       {
          sts = EssGetProcessState (hCtx, &pState);
          while (!sts || (pState.State != ESS_STATE_DONE))
             sts = EssGetProcessState (hCtx, &pState);
       }
       sts = EssOtlCloseOutline(hOutline);
       printf("EssOtlCloseOutline() sts: %ld\n",sts);

       EssOtlFreeStructure(hInst, ESS_DT_STRUCT_ATTRSPECS, 1,&AttrSpecs);
    }

See Also

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