AddStub(Name: String; Stub: IVariableStub);
Name. Cube name.
Stub. Added cube.
The AddStub method adds a cube as a data source of MsExpressionEdit.
To use cube facts in expression:
Enter cube name that is set by the Name parameter.
Put the "!" character.
Press CTRL+SPACE. The drop-down list containing cube facts is displayed.
Select the required fact in the list.
The selected fact is inserted into the MsExpressionEdit expression.
Executing the example requires that the repository contains a form with the MsExpressionEdit component with the MSEXPRESSIONEDIT1 identifier. The repository must contain a cube with the CUBE identifier.
Add links to the Cubes, Metabase, Ms 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;
After executing the example, facts of the CUBE cube can be used in the MSEXPRESSIONEDIT1 expression, names of operands are displayed in full.
See also: