AddStub(Name: String; Stub: IVariableStub);
AddStub(Name: string; Stub: Prognoz.Platform.Interop.Cube.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 set by the Name parameter.
Put the "!" character.
Click the CTRL + Space key combination.
The drop-down list containing cube facts is displayed. Select the required fact.
The selected fact is inserted into the MsExpressionEdit expression.
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.
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: