EssLROAddObject

Links reporting objects to a data cell in an Essbase database.

Syntax

ESS_FUNC_M EssLROAddObject (hCtx, memCount, pMemComb, usOption, 
pLRODesc);
ParameterData TypeDescription

hCtx

ESS_HCTX_T

API context handle.

memCount

ESS_ULONG_T

The number of members specified in pMemComb.

pMemComb

ESS_PVOID_T

Array of the member names that define the data cell to be linked.

usOption

ESS_USHORT_T

Option specifying where to store the object. Use one of these values:

  • ESS_STORE_OBJECT_API to store an object on the server.

  • ESS_NOSTORE_OBJECT_API to not store the object on a server.

pLRODesc

ESS_LRODESC_API_T

Pointer to object's description structure.

Notes

Return Value

If successful, returns ESS_STS_NOERR. Otherwise, returns an error code.

Access

A call to this function requires write privileges (ESS_PRIV_WRITE) to the active database.

Example

ESS_STS_T  ESS_LROAddObject (ESS_HCTX_T hCtx, ESS_HINST_T hInst)
{
        ESS_STS_T                       sts = ESS_STS_NOERR;
        ESS_PMBRNAME_NONUNI_T   pMemComb = NULL;
        ESS_LRODESC_API_T               lroDesc;
        ESS_USHORT_T            usOption = 0;
        ESS_ULONG_T             memCount;

        memset (&lroDesc, 0 , sizeof(ESS_LRODESC_API_T));
        
        lroDesc.usObjType = 0;    /* Creating a cell note */
        strcpy(lroDesc.lro.note, "The profit for Colas in the East based on actuals"); 
        usOption = ESS_NOSTORE_OBJECT_API;  
        strcpy(lroDesc.userName, "user1");
        memCount = 5;

        sts = EssAlloc(hInst, memCount*sizeof(ESS_MBRNAME_NONUNI_T), 
                                        (ESS_PPVOID_T)&pMemComb);
        if (sts) 
        {
                printf("could not allocate memory\n");
                return sts;
        }
        
        memset(pMemComb, 0, memCount*sizeof(ESS_MBRNAME_NONUNI_T));
        strcpy( pMemComb[0], "Profit");
        strcpy( pMemComb[1], "East");
        strcpy( pMemComb[2], "Actual");
        strcpy( pMemComb[3], "Colas");
        strcpy( pMemComb[4], "Year");
        
        sts = EssLROAddObject( hCtx, memCount, pMemComb, usOption, &lroDesc);

        if (sts)
        {
                printf( "Could not attach LRO\n");
        }
        EssFree(hInst, pMemComb);
        return sts;
}

See Also