EnableFormulas: Boolean;
The EnableFormulas property determines whether formulas are calculated in cells.
Available values:
True. Formulas are calculated in cells.
False. Formulas are not calculated in cells.
Executing the example requires containing a regular report with the Reg_rep identifier.
Add links to the Metabase, Report and Tab system assemblies.
Sub UserProc;
Var
MB: IMetabase;
MObj: IMetabaseObject;
Rep: IPrxReport;
Tab: ITabSheet;
Sheet: IPrxTable;
Begin
MB := MetabaseClass.Active;
MObj := MB.ItemById("Reg_rep").Edit;
Rep := MObj As IPrxReport;
Sheet := Rep.Sheets.Item(0) As IPrxTable;
Tab := Sheet.TabSheet;
Tab.Cell(0, 0).Value := 10;
Tab.Cell(0, 1).Value := 20;
Tab.Cell(0, 2).Value := 30;
Tab.EnableFormulas := True;
Tab.Cell(1, 0).Formula := "=A0+B0";
Tab.Cell(1, 1).Formula := Tab.AdjustFormula(Tab.Cell(1, 0).Formula, Tab.Cell(1, 0), Tab.Cell(1, 1));
MObj.Save;
End Sub UserProc;
After executing the example the formula that sums values of the A0 and B0 cells is set for the A1 cell. Then this formula is corrected for the B1 cell.
See also: