EsbOtlSetMemberFormula() sets the formula for a specified member.
EsbOtlSetMemberFormula (hOutline, hMember, pszFormula)
ByVal hOutline As Long ByVal hMember As Long ByVal pszFormula As String
hOutline | Outline context handle. |
hMember | Member handle. |
pszFormula | Buffer containing the member formula. |
Returns 0 if successful; otherwise one of the following:
OTLAPI_ERR_SHAREDMEMBERFORMULA
OTLAPI_ERR_MEMBERCALC
Declare Function EsbOtlSetMemberFormula Lib "ESBOTLW" (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 Sub