IBindingDimCombo.ParamValues

Syntax

ParamValues: IBindingObjectParamValues;

Description

The ParamValues property returns collection of parametric dictionary parameters.

Comments

To determine parameter values of parametric dictionary in binding string, two methods are implemented:

  1. PARAMVALUEx, where x - parameter number, for example, PARAMVALUE1 = "10". Parameter numbering starts from 1.

  2. PARAMID_ident, where ident - parameter identifier, for example, PARAMID_Item = "10".

To set parameter values using the first method, use the IBindingObjectParamValues.Item property in the collection; to set parameter values using the second method, use the IBindingObjectParamValues.Value property.

Example

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.

See also:

IBindingDimCombo