Value: Variant;
Value: Object;
The Value property determines the value set in a control.
The value determined in the Value property depends on the type of control in use:
For the BooleanCombo control: logical value True or False.
For the CheckBox control: logical value True or False
For the ComboBox control: name of the element missing in the list of control.
For the DatePicker control: a value of the DateTime type containing the required value of date component.
For the DateTimePicker control: a value of the DateTime type containing the required values of date and time components.
For the DecimalEdit control: a value of the Decimal type.
For the DimCombo control: different values are available, for details see the comments below.
For the EditBox control: any string value.
For the FloatEdit control: any real value.
For the IdentEdit control: Any string value satisfying requirements to identifiers.
For the IntegerEdit control: any integer value.
For the MaskEdit control: value according to the set input template.
For the TimePicker control: value of the DateTime type containing the required value of time component.
For the TreeCombo control: name of an element available in the list of control.
On using the DimCombo control, depending on whether there is an binding to control the dimension, different values of the Value property are available:
If a control is not linked with the dimension or linked with the dimension of the analytical data area described by the IEaxDataArea interface, the Value property can be:
Attribute value on single selection.
Array of the Variant type with attribute values on multiple selection.
The attribute is set in the ATTRIBUTEVALUE parameter in the connection string. If the ATTRIBUTEVALUE parameter is missing, an attribute with the Identifier purpose is used. On forming a connection string, value of the ATTRIBUTEVALUE parameter can be determined by means of the ValueAttribute property.
If a control is linked with the dimension of the data area described by the IPrxDataIsland interface, the value of the Value property is specified as a dictionary selection described by the IDimSelection interface. The selection must correspond to the dictionary that is used as a control.
To reset value of the control, set the Value property to Null.
Sub GetControlValue(Control: IPrxControl);
Var
Arr: Array;
i: Integer;
BM: IBindingManager;
Binding: IBindingValue;
Begin
//If a control has a value, get and display it in the console
If Control.Value.VarType <> ForeVariantType.NullValue Then
Debug.Write("Value(s) of control: ");
//If it is an array, view values of all array elements
If Control.Value.VarType = ForeVariantType.Matrix Then
Arr := Control.Value As Array;
For i := 0 To Arr.Length - 1 Do
Debug.Write(Arr[i] + " ");
End For;
Debug.WriteLine("");
//If it is an object, cast it to IDimSelection and get the number of selected
Elseif Control.Value.VarType = ForeVariantType.Object Then
Debug.WriteLine("Selection IDimSelection. Selected: " + (Control.Value As IDimSelection).SelectedCount.ToString);
//If it is not an array, neither an object, display its value
Else
Debug.WriteLine(Control.Value);
End If;
//Attribute that controls value
BM := New BindingManager.Create;
Binding := BM.CreateByValue(Control.Binding);
Debug.WriteLine("Attribute that controls value: "
+ (Binding As IBindingDimCombo).ValueAttribute);
End If;
End Sub GetControlValue;
The specified function can be used to get value of the control, which is based on the DimCombo editor. The obtained values are displayed in the development environment console and also the identifier of the dictionary attribute, which values form value of the control.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Dimensions;
Imports Prognoz.Platform.Interop.ForeSystem;
Imports Prognoz.Platform.Interop.Report;
Sub GetControlValue(Control: IPrxControl);
Var
Arr: Array;
i: Integer;
BM: IBindingManager = New BindingManagerClass();
Binding: IBindingValue;
Begin
//If a control has a value, get and display it in the console
If Control.Value <> Null Then
System.Diagnostics.Debug.Write("Value(s) of control: ");
//If it is an array, view values of all array elements
If Control.Value Is Array Then
Arr := Control.Value As Array;
For i := 0 To Arr.Length - 1 Do
System.Diagnostics.Debug.Write(Arr[i] + " ");
End For;
System.Diagnostics.Debug.WriteLine("");
//If it is an object, cast it to IDimSelection and get the number of selected
Elseif Control.Value Is IDimSelection Then
System.Diagnostics.Debug.WriteLine("Selection IDimSelection. Selected: " + (Control.Value As IDimSelection).SelectedCount.ToString());
//If it is not an array, neither an object, display its value
Else
System.Diagnostics.Debug.WriteLine(Control.Value);
End If;
//Attribute that controls value
Binding := BM.CreateByValue(Control.Binding);
System.Diagnostics.Debug.WriteLine("Attribute that controls value: "
+ (Binding As IBindingDimCombo).ValueAttribute);
End If;
End Sub;
See also: