See below the example of viewing information about calculated cube structure: information about data sources, source dimensions and the calculated cube dimensions is displayed. The information is displayed in the development environment console. Executing the example requires that the repository contains a calculated cube with the CalculatedCube identifier. Add links to the Cubes, Dimensions, Metabase system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Cube: ICalculatedCube;
CubeSource: ICalculatedCubeSource;
CubeDim: ICalculatedCubeDimension;
MDesc: IMetabaseObjectDescriptor;
Begin
MB := MetabaseClass.Active;
Cube := MB.ItemById("CalculatedCube").Bind As ICalculatedCube;
//Information about calculated cube sources and their dimensions
For Each CubeSource In Cube.Sources Do
Debug.WriteLine("Source: " + CubeSource.Name + '(' + CubeSource.Id + ')');
Debug.WriteLine("Source dimensions:");
Debug.Indent;
For Each CubeDim In CubeSource.Dimensions Do
MDesc := CubeDim.Dimension As IMetabaseObjectDescriptor;
Debug.WriteLine(MetabaseClass.CommonClassName(MDesc.ClassId As MetabaseObjectClass) + ": " + MDesc.Name + '(' + MDesc.Id + ')');
End For;
Debug.Unindent;
End For;
//Information about calculated cube dimensions
Debug.WriteLine("Calculated cube dimensions:");
For Each CubeDim In Cube.Dimensions Do
MDesc := CubeDim.Dimension As IMetabaseObjectDescriptor;
Debug.Indent;
Debug.Write(MetabaseClass.CommonClassName(MDesc.ClassId As MetabaseObjectClass) + ": " + MDesc.Name + '(' + MDesc.Id + ". ");
If CubeDim.Fixed Then
Debug.WriteLine("Fixed");
Else
Debug.WriteLine("Non-fixed");
End If;
Debug.Unindent;
End For;
End Sub UserProc;
Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Dimensions;
Imports Prognoz.Platform.Interop.Metabase;
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
MBClass: IMetabaseClass = New MetabaseClassClass();
Cube: ICalculatedCube;
CubeSource: ICalculatedCubeSource;
CubeDim: ICalculatedCubeDimension;
MDesc: IMetabaseObjectDescriptor;
Begin
MB := Params.Metabase;
Cube := MB.ItemById["CalculatedCube"].Bind() As ICalculatedCube;
//Information about calculated cube sources and their dimensions
For Each CubeSource In Cube.Sources Do
System.Diagnostics.Debug.WriteLine("Source: " + CubeSource.Name + '(' + CubeSource.Id + ')');
System.Diagnostics.Debug.WriteLine("Source dimensions:");
System.Diagnostics.Debug.Indent();
For Each CubeDim In CubeSource.Dimensions Do
MDesc := CubeDim.Dimension As IMetabaseObjectDescriptor;
System.Diagnostics.Debug.WriteLine(MBClass.CommonClassName[MDesc.ClassId As MetabaseObjectClass, NameCasePlural.ncNominative] + ": " + MDesc.Name + '(' + MDesc.Id + ')');
End For;
System.Diagnostics.Debug.Unindent();
End For;
//Information about calculated cube dimensions
System.Diagnostics.Debug.WriteLine("Calculated cube dimensions:");
For Each CubeDim In Cube.Dimensions Do
MDesc := CubeDim.Dimension As IMetabaseObjectDescriptor;
System.Diagnostics.Debug.Indent();
System.Diagnostics.Debug.Write(MBClass.CommonClassName[MDesc.ClassId As MetabaseObjectClass, NameCasePlural.ncNominative] + ": " + MDesc.Name + '(' + MDesc.Id + ". ");
If CubeDim.Fixed Then
System.Diagnostics.Debug.WriteLine("Fixed");
Else
System.Diagnostics.Debug.WriteLine("Not fixed");
End If;
System.Diagnostics.Debug.Unindent();
End For;
End Sub;
See also: