Gets the calc equation for a specific member in the active database outline.
Syntax
ESS_FUNC_M EssGetMemberCalc (hCtx, MbrName, pCalcStr, pLastCalcStr);
Parameter | Data Type | Description |
---|---|---|
hCtx | ESS_HCTX_T | API context handle. |
MbrName | ESS_STR_T | Member name. |
pCalcStr | ESS_PSTR_T | Address of pointer to receive allocated member calc string. |
pLastCalcStr | ESS_PSTR_T | Address of pointer to receive allocated member last calc string. |
Notes
The last calc string is the formula used to calculate the member the last time the database was calculated. It might be left from pCalStr if a calc script was used to calculate the database.
This function checks whether the relational span Boolean is set and can determine if members stored in attached relational data sets have calc strings, but returns a NULL string instead of the calc string.
The memory allocated for pCalcStr and pLastCalcStr should be freed using EssFree().
Return Value
If successful, this function returns the calc string and last calc string in pCalcStr and pLastCalcStr.
Access
This function requires the caller to have at least read access (ESS_PRIV_READ) to the database, and to have selected it as their active database using EssSetActive().
Example
ESS_FUNC_M ESS_GetMbrCalc (ESS_HCTX_T hCtx, ESS_HINST_T hInst ) { ESS_FUNC_M sts = ESS_STS_NOERR; ESS_STR_T calcStr, lastCalcStr; calcStr = lastCalcStr = NULL; sts = EssGetMemberCalc(hCtx, "Year", &calcStr, &lastCalcStr); if (!sts) { if (calcStr) { printf ("Outline Defined Calc Equation -- [%s]\r\n", calcStr); } else { printf ("Outline Defined Calc Equation -- [Default Rollup]\r\n"); } if (lastCalcStr) { printf ("Last Calculated Calc Equation -- [%s]\r\n", lastCalcStr); } else { if (calcStr) printf ("Last Calculated Calc Equation -- [%s]\r\n", calcStr); else printf ("Last Calculated Calc Equation -- [Default Rollup]\r\n"); } } if (calcStr) EssFree (hInst, calcStr); if (lastCalcStr) EssFree (hInst, lastCalcStr); return (sts); }
See Also