EsbCalc() sends and optionally executes a calc script against the active database as a single string. This function is equivalent to making a call to EsbBeginCalc, followed by calls to EsbSendString(), and finally to EsbEndCalc(). The calculation can either be initiated, or the calc script can just be verified and any errors returned.
EsbCalc (hCtx, isCalculate, cscQuery)
ByVal hCtx As Long ByVal isCalculate As Integer ByVal cscQuery As String
| hCtx | Essbase VB API context handle. |
| isCalculate | Controls calculation of the calc script. If TRUE, the calc script is executed. |
| cscQuery | The calc script, as a single string (must be less than 64 Kbytes). |
Declare Function EsbCalc Lib "ESBAPIW" (ByVal hCtx As Long, ByVal Calculate As Integer, ByVal Script As String) As Long
Sub ESB_Calc ()
Dim sts As Long
Dim Script As String
Dim Calculate As Integer
Dim ProcState As ESB_PROCSTATE_T
Script = "CALC ALL;"
Calculate = ESB_YES
'**********
' Calculate
'**********
sts = EsbCalc (hCtx, Calculate, Script)
'************************************
' Check process state till it is done
'************************************
sts = EsbGetProcessState (hCtx, ProcState)
Do Until ProcState.State = ESB_STATE_DONE
sts = EsbGetProcessState (hCtx, ProcState)
Loop
End Sub
EsbBeginCalc()