ParamValues: IBindingObjectParamValues;
ParamValues: Prognoz.Platform.Interop.ForeSystem.IBindingObjectParamValues;
The ParamValues property returns collection of parametric dictionary parameters.
To determine parameter values of parametric dictionary in binding string, two methods are implemented:
PARAMVALUEx, where x - parameter number, for example, PARAMVALUE1 = "10". Parameter numbering starts from 1.
PARAMID_ident, where ident - parameter identifier, for example, PARAMID_Item = "10".
To set parameters by means of the first method, use the IBindingObjectParamValues.Item property in the collection, to set parameters by means of the second method, use the IBindingObjectParamValues.Value property.
Function CreateDimComboBidningWithParams(Dimension: IMetabaseObjectDescriptor; Paramarray ParamValues: Array Of String): String;
Var
BM: IBindingManager;
DimModel: IDimensionModel;
DimComboBinding: IBindingDimCombo;
Params: IBindingObjectParamValues;
i: Integer;
Begin
BM := New BindingManager.Create;
DimModel := Dimension.Bind As IDimensionModel;
//Set up editor parameters
DimComboBinding := BM.CreateByUi("DimCombo") As IBindingDimCombo;
DimComboBinding.Object := Dimension.Id;
Params := DimComboBinding.ParamValues;
//If parameters values are passed
If ParamValues <> Null Then
//If it is a calendar dictionary, parameters are set via the Value property
//For all the other dictionary types - via the Item property
If (DimModel Is ICalendarDimension) Then
Params.Value("PARAMID_YEAR_START") := ParamValues[0];
Params.Value("PARAMID_YEAR_FINISH") := ParamValues[1];
Else
For i := 1 To ParamValues.Length Do
Params.Item(i) := ParamValues[i - 1];
End For;
End If;
End If;
Return DimComboBinding.AsString;
End Function CreateDimComboBidningWithParams;
This function generates a binding string to use the value editor as a drop-down list of the dictionary. Dictionary description is passed as the Dimension input parameter, parameter values for opening parametric dictionary are passed as ParamValues. Depending on the dictionary type, parameters in the binding string are specified by two different methods.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Dimensions;
Imports Prognoz.Platform.Interop.ForeSystem;
Function CreateDimComboBidningWithParams(Dimension: IMetabaseObjectDescriptor; Paramarray ParamValues: Array Of String): String;
Var
BM: IBindingManager = New BindingManagerClass();
DimModel: IDimensionModel;
DimComboBinding: IBindingDimCombo;
Params: IBindingObjectParamValues;
i: Integer;
Begin
DimModel := Dimension.Bind() As IDimensionModel;
//Set up editor parameters
DimComboBinding := BM.CreateByUi("DimCombo") As IBindingDimCombo;
DimComboBinding.Object := Dimension.Id;
Params := DimComboBinding.ParamValues;
//If parameters values are passed
If ParamValues <> Null Then
//If it is a calendar dictionary, parameters are set via the Value property
//For all the other dictionary types - via the Item property
If (DimModel Is ICalendarDimension) Then
Params.Value["PARAMID_YEAR_START"] := ParamValues[0];
Params.Value["PARAMID_YEAR_FINISH"] := ParamValues[1];
Else
For i := 1 To ParamValues.Length Do
Params.Item[i] := ParamValues[i - 1];
End For;
End If;
End If;
Return DimComboBinding.AsString;
End Function;
See also: