ShowFormulaEditor Command

Purpose

It displays the standard dialog box of the editor to set up a dimension element.

Parameters of Use

Value type Description
IEaxAnalyzer The express report, for which an expression must be created. Mandatory parameter.
IEaxDataAreaTransformation The object that is used to work with a data transformation formula. Mandatory parameter.
IDimInstance It contains properties and methods of access to dictionary data. It is required to search for a transformation element. Optional parameter.
IDimSelectionSet Selection used to build table.
Boolean The checkbox determines whether the filter settings panel is available. Available values:
  • True. Use filtering.
  • False. Do not use filtering.

Optional parameter.

IEaxDataArea Returns parameters of the analytical data area. Optional parameter.

Example

Executing the example requires a form, buttons named BUTTON1 and BUTTON2 on the form, the UiErAnalyzer component named UIERANALYZER1 that is a data source for the TabSheetBox1 component, the UiReport1 component that is a data source for the Tabsheetbox2 component. An express report with the FACTS identifier, which contains the calculated element, is connected to UiErAnalyzer1; a regular report with a dimension with the FACTS identifier, which contains the calculated element, is connected to Uireport1.

Add links to the Express, Pivot, Tab, Ui, Dimension and Report system assemblies.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    Express: IEaxAnalyzer;
    Transform: IEaxDataAreaTransformation;
    SelectSet: IDimSelectionSet;
    DimSelect: IDimSelection;
    Data: Array;
    Context: IUiCommandExecutionContext;
    Target: IUiCommandTarget;

Begin
    //Get express report
    Express := UiErAnalyzer1.ErAnalyzer;
    //Get selection, by which table is built
    SelectSet := Express.Pivot.Selection;
    //Get data slice
    Transform := Express.DataArea.Slices.Item(0).CalcTransformations.Item(0);
    
//Get dimension with calculated element
    DimSelect := SelectSet.FindById(
"FACTS");
    //Specify required array elements
    Data := New Variant[6];
    Data[
0] := Express;
    Data[
1] := Transform;
    Data[
2] := DimSelect.Dimension;
    Data[
3] := SelectSet;
    Data[
4] := True;
    Data[
5] := Express.DataArea;
    //Open obtained express report for view
    Target := WinApplication.Instance.GetPluginTarget("Express");
    Context := Target.CreateExecutionContext;
    Context.Data := Data;
    Target.Execute(
"ShowFormulaEditor", Context);
End Sub Button1OnClick;

Sub Button2OnClick(Sender: Object; Args: IMouseEventArgs);
    
Var
    Report: IPrxReport;
    Slice: IEaxDataAreaTransformation;
    DimSelect: IDimSelection;
    SelectSet: IDimSelectionSet;
    Data: Array;
    Context: IUiCommandExecutionContext;
    Target: IUiCommandTarget;
    DataArea: IEaxDataArea;
    PivSlice: IEaxDataAreaPivotSlice;
    Pivot: IPivot;
Begin
    
//Get report
    Report := UiReport1.Report;
    
// Get analytical data area of regular report
    DataArea := Report.DataArea;
    
// Get base for building analytical area slice
    PivSlice := DataArea.Slices.Item(0As IEaxDataAreaPivotSlice;
    
//Get selection, by which table is built
    Pivot := PivSlice.Pivot;
    SelectSet := Pivot.Selection;
    
//Get data slice
    Slice := Report.DataArea.Slices.Item(0).CalcTransformations.Item(0);
    
//Get dimension with calculated element
    DimSelect := SelectSet.FindById("FACTS");
    
//Specify necessary array elements        
    Data := New Variant[6];
    Data[
0] := Pivot;
    Data[
1] := Slice;
    Data[
2] := DimSelect.Dimension;
    Data[
3] := SelectSet;
    Data[
4] := True;
    Data[
5] := Report.DataArea;
    
//Open report for view
    Target := WinApplication.Instance.GetPluginTarget("Express");
    Context := Target.CreateExecutionContext;
    Context.Data := Data;
    Target.Execute(
"ShowFormulaEditor", context);
End Sub Button2OnClick;

After clicking the Button1 button a dialog box of expression editor for express report calculated element opens, which contains the element formula that can be edited:

After clicking the Button2 button a dialog box of expression editor for regular report calculated element opens, which contains the element formula that can be edited:

See also:

IUiCommandTarget.Execute