ITabSheet.EnableFormulas

Fore Syntax

EnableFormulas: Boolean;

Fore.NET Syntax

EnableFormulas: boolean;

Description

The EnableFormulas property determines whether formulas are calculated in cells.

Comments

Available values:

Fore Example

To execute the example a regular report with the Reg_rep identifier is required.

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(0As IPrxTable;
    Tab := Sheet.TabSheet;
    Tab.Cell(00).Value := 10;
    Tab.Cell(01).Value := 20;
    Tab.Cell(02).Value := 30;
    Tab.EnableFormulas := True;
    Tab.Cell(10).Formula := "=A0+B0";
    Tab.Cell(11).Formula := Tab.AdjustFormula(Tab.Cell(10).Formula, Tab.Cell(10), Tab.Cell(11));
    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.

Fore.NET Example

The requirements and result of Fore.NET Example execution match with those in the Fore Example.

Imports Prognoz.Platform.Interop.Report;
Imports Prognoz.Platform.Interop.Tab;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    MObj: IMetabaseObject;
    Rep: IPrxReport;
    Tab: ITabSheet;
    Sheet: IPrxTable;
Begin
    MB := Params.Metabase;
    MObj := MB.ItemById["Reg_rep"].Edit();
    Rep := MObj As IPrxReport;
    Sheet := Rep.Sheets.Item[0As IPrxTable;
    Tab := Sheet.TabSheet;
    Tab.Cell[00].Value := 10;
    Tab.Cell[01].Value := 20;
    Tab.Cell[02].Value := 30;
    Tab.EnableFormulas := True;
    Tab.Cell[10].Formula := "=A0+B0";
    Tab.Cell[11].Formula := Tab.AdjustFormula(Tab.Cell[10].Formula, Tab.Cell[10], Tab.Cell[11]);
    MObj.Save();
End Sub;

See also:

ITabSheet