IMsExpressionEdit.AddStub

Fore Syntax

AddStub(Name: String; Stub: IVariableStub);

Fore.NET Syntax

AddStub(Name: string; Stub: Prognoz.Platform.Interop.Cube.IVariableStub);

Parameters

Name. Cube name.

Stub. Added cube.

Description

The AddStub method adds a cube as a data source of MsExpressionEdit.

Comments

To use cube facts in expression:

  1. Enter cube name set by the Name parameter.

  2. Put the "!" character.

  3. Click the CTRL + Space key combination.

  4. The drop-down list containing cube facts is displayed. Select the required fact.

The selected fact is inserted into the MsExpressionEdit expression.

Fore Example

Executing the example requires a form and the MsExpressionEdit component with the MsExpressionEdit1 identifier. The repository must contain a cube with the CUBE identifier.

Add links to the Cubes Metabase system assemblies.

Sub UserProc;
Var
    mb: IMetabase;
    Stub: IVariableStub;
Begin
    mb := MetabaseClass.Active;
    // Get cube
    Stub := mb.ItemById("CUBE").Bind As IVariableStub;
    // Connect cube to MsExpressionEdit1
    MsExpressionEdit1.AddStub("Cube", Stub);
    // Set mode of displaying operands
    MsExpressionEdit1.UseFullVariableNames := True;
End Sub UserProc;

Example execution result: facts of the CUBE cube can be used in the MsExpressionEdit1 expression, names of operands are displayed in full.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example. Use Fore.NET analogs instead of Fore components.

Imports Prognoz.Platform.Interop.Cubes;

Public Sub UserProc();
Var
    mb: IMetabase;
    Stub: IVariableStub;
Begin
    mb := Self.Metabase;
    // Get cube
    Stub := mb.ItemById["CUBE"].Bind() As IVariableStub;
    // Connect cube to MsExpressionEdit1
    msExpressionEditNet1.CtrlBox.AddStub("Cube", Stub);
    // Set mode of displaying operands
    msExpressionEditNet1.CtrlBox.UseFullVariableNames := True;
End Sub UserProc;

See also:

IMsExpressionEdit