Count: Integer;
Count: Integer;
The Count property returns the number of nested objects, the parameters of which can be controlled.
Executing the example requires a cube with the STD_CUBE identifier in repository. Add a link to the Metabase system assembly.
Sub UserProc;
Var
MB: IMetabase;
Obj, ControlObj: IMetabaseObjectDescriptor;
ControlInfo: IMetabaseObjectControlInfo;
Control: IMetabaseObjectControl;
ParamControl: IMetabaseObjectParamControl;
Param: IMetabaseObjectParam;
i, j: Integer;
Begin
MB := MetabaseClass.Active;
Obj := Mb.ItemById("STD_CUBE");
ControlInfo := Obj.Params.ControlInfo;
For i := 0 To ControlInfo.Count - 1 Do
Control := ControlInfo.Item(i);
ControlObj := Control.ControlledObject;
Debug.Write("Nested object: " + ControlObj.Name + '(' + ControlObj.Id + ").");
If Control.Count = 0 Then
Debug.WriteLine(" Parameters are absent.");
Else
Debug.WriteLine("");
Debug.Indent;
For j := 0 To Control.Count - 1 Do
ParamControl := Control.Item(j);
Param := ParamControl.ControlledParam;
Debug.WriteLine("Parameter: " + Param.Name + '(' + Param.Id + ").");
End For;
Debug.Unindent;
End If;
End For;
End Sub UserProc;
After executing the example the development environment console displays information about cube nested objects and their parameters.
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;
Obj, ControlObj: IMetabaseObjectDescriptor;
ControlInfo: IMetabaseObjectControlInfo;
Control: IMetabaseObjectControl;
ParamControl: IMetabaseObjectParamControl;
Param: IMetabaseObjectParam;
i, j: Integer;
Begin
MB := Params.Metabase;
Obj := Mb.ItemById["STD_CUBE"];
ControlInfo := Obj.Params.ControlInfo;
For i := 0 To ControlInfo.Count - 1 Do
Control := ControlInfo.Item[i];
ControlObj := Control.ControlledObject;
System.Diagnostics.Debug.Write("Nested object: " + ControlObj.Name + '(' + ControlObj.Id + "). ");
If Control.Count = 0 Then
System.Diagnostics.Debug.WriteLine("Parameters are absent.");
Else
System.Diagnostics.Debug.WriteLine("");
System.Diagnostics.Debug.Indent();
For j := 0 To Control.Count - 1 Do
ParamControl := Control.Item[j];
Param := ParamControl.ControlledParam;
System.Diagnostics.Debug.WriteLine("Parameter: " + Param.Name + '(' + Param.Id + ").");
End For;
System.Diagnostics.Debug.Unindent();
End If;
End For;
End Sub;
See also: