IMetabaseObjectParamControl.Expression

Fore Syntax

Expression: IExpression;

Fore.NET Syntax

Expression: Prognoz.Platform.Interop.ForeSystem.IExpression;

Description

The Expression property returns an expression that determines binding of a current parameter of embedded object to parameters of current object.

Fore Example

Executing the example requires a cube with the STD_CUBE identifier in repository. This cube has the dimension in the structure which is built basing the COUNTRY parametric dictionary. The number of parameters created in cube structure corresponds to the number of dictionary parameters.

Sub UserProc;
Var
    MB: IMetabase;
    MObj: IMetabaseObject;
    Params: IMetabaseObjectParams;
    ControlInfo: IMetabaseObjectControlInfo;
    Control: IMetabaseObjectControl;
    Param: IMetabaseObjectParamControl;
    i: Integer;
Begin
    MB := MetabaseClass.Active;
    MObj := Mb.ItemById("STD_CUBE").Edit;
    //Parameters of the cube
    Params := MObj.Params;
    ControlInfo := Params.ControlInfo;
    Control := ControlInfo.FindByKey(MB.GetObjectKeyById("COUNTRY"));
    //Binding of nested object parameters
    For i := 0 To Control.Count - 1 Do
        Param := Control.Item(i);
        Param.Expression.AsString := ':' + Params.Item(i).Id;
    End For;
    MObj.Save;
End Sub UserProc;

After executing the example parameter management is set up for the determined dictionary. On cube opening, after parameter values are inputted, those values will be also sent to open the dictionary.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.Metabase;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    MObj: IMetabaseObject;
    ObjParams: IMetabaseObjectParams;
    ControlInfo: IMetabaseObjectControlInfo;
    Control: IMetabaseObjectControl;
    Param: IMetabaseObjectParamControl;
    i: Integer;
Begin
    MB := Params.Metabase;
    MObj := Mb.ItemById["STD_CUBE"].Edit();
    //Parameters of the cube
    ObjParams := MObj.Params;
    ControlInfo := ObjParams.ControlInfo;
    Control := ControlInfo.FindByKey(MB.GetObjectKeyById("COUNTRY"));
    //Binding of the nested object parameters
    For i := 0 To Control.Count - 1 Do
        Param := Control.Item[i];
        Param.Expression.AsString := ':' + ObjParams.Item[i].Id;
    End For;
    MObj.Save();
End Sub;

See also:

IMetabaseObjectParamControl