Sets the formula for a specified member.
Syntax
EsbOtlSetMemberFormula (hOutline, hMember, pszFormula) ByVal hOutline As Long ByVal hMember As Long ByVal pszFormula As String
| Parameter | Description |
|---|---|
hOutline | Outline context handle. |
hMember | Member handle. |
pszFormula | Buffer containing the member formula. |
Notes
Use EsbOtlDeleteMemberFormula() to remove a member formula.
Return Value
Returns 0 if successful; otherwise one of the following:
OTLAPI_ERR_SHAREDMEMBERFORMULA
OTLAPI_ERR_MEMBERCALC
Example
Declare Function EsbOtlSetMemberFormula Lib
"ESBOTLN" (ByVal hOutline As Long, ByVal hMember As Long,
ByVal pszFormula As String) As Long
Sub ESB_OtlSetMemberFormula()
Dim sts As Long
Dim Object As ESB_OBJDEF_T
Dim hOutline As Long
Dim hMemberProfit As Long
Dim szFormula as String * 100
Object.hCtx = hCtx
Object.Type = ESB_OBJTYPE_OUTLINE
Object.AppName = "Sample"
Object.DbName = "Basic"
Object.FileName = "Basic"
sts = EsbOtlOpenOutline(hCtx, Object,
ESB_YES, ESB_YES, hOutline)
If sts = 0 Then
sts = EsbOtlFindMember(hOutline, "Profit",
hMemberProfit)
End If
If sts = 0 hMemberProfit <> 0 Then
szFormula = "Profit = Gross / Margin;"
sts = EsbOtlSetMemberFormula(hOutline,
hMemberProfit, szFormula)
End If
End SubSee Also