Show contents 

Report > Report Assembly Interfaces > IPrxFormulaIsland > IPrxFormulaIsland.Edit

IPrxFormulaIsland.Edit

Syntax

Edit: IPrxFormulaIsland;

Description

The Edit method opens a formula area for edit.

Example

Executing the example requires that the repository contains a regular report with the REPORT identifier that contains a formula area.

Add links to the Drawing, Metabase, Report, Tab system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    MObj: IMetabaseObject;
    Report: IPrxReport;
    Sheets: IPrxSheets;
    FormulaIs: IPrxFormulaIslands;
    Formula: IPrxFormulaIsland;
    FSheetTab: IPrxTable;
    Table: ITabSheet;
    Range: ITabRange;
    Style: IPrxCellStyle;
Begin
    MB := MetabaseClass.Active;
    // Get regular report
    MObj := MB.ItemById("OBJ306221").Edit;
    Report := MObj As IPrxReport;
    Sheets := Report.Sheets;
    // Get formula area
    FormulaIs := Report.FormulaIslands;
    Formula := FormulaIs.Item(0);
    // Copy formula area
    Formula.Copy(Sheets.Item(Sheets.Count - 1), Formula.Range);
    // Change basic cell of formula area
    Formula := Formula.Edit;
    FSheetTab := Formula.Sheet As IPrxTable;
    Table := FSheetTab.TabSheet;
    Range := Table.Cell(1,0);
    Formula.Origin := Range;
    Formula.Formula := "G5";
    // Apply style
    Style := Formula.Style;
    Style.BackgroundBrush := New GxSolidBrush.Create(GxColor.FromName("Red"));
    Style.Font.Bold := TriState.OnOption;
    Style.Font.Color := New GxColor.CreateRGB(00255);
    // Save changes in formula area
    Formula.Save;
    // Calculate formula area
    Formula.Recalc;
    // Save changes in report
    MObj.Save;
End Sub UserProc;

After executing the example the basic formula area cell is replaced with the A1 cell, a copy of the first formula area is created on the last sheet of the regular report, and formatting parameters and formula are set.

See also:

IPrxFormulaIsland