GetDimension(DimensionObj: IMetabaseObject): IDimInstance;
GetDimension(DimensionObj: Prognoz.Platform.Interop.Metabase.IMetabaseObject): Prognoz.Platform.Interop.Dimensions.IDimInstance;
DimensionObj. Repository dictionary.
The GetDimension method returns data of the specified dictionary from cache.
Executing the example requires that the repository contains a dictionary with the D_FACTS identifier.
Add links to the Cubes, Dimensions system assemblies. Metabase.
Sub UserProc;
Var
Mb: IMetabase;
MObj: IMetabaseObject;
InMem: IInMemManager;
DimInst: IDimInstance;
Begin
Mb := MetabaseClass.Active;
MObj := Mb.ItemById("D_FACTS").Bind;
InMem := New InMemManager.Create;
If InMem.CheckHasDimension(MObj) Then
DimInst := InMem.GetDimension(MObj);
Debug.WriteLine("Number of elements: " + DimInst.Elements.Count.ToString);
End If;
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;
MObj: IMetabaseObject;
InMem: InMemManager = New InMemManagerClass();
DimInst: IDimInstance;
Begin
Mb := Params.Metabase;
MObj := Mb.ItemById["D_FACTS"].Bind();
If InMem.CheckHasDimension(MObj) Then
DimInst := InMem.GetDimension(MObj);
System.Diagnostics.Debug.WriteLine("Number of elements: " + DimInst.Elements.Count.ToString());
End If;
End Sub;
On executing the example, it will be checked if cache contains data for the specified dictionary. If cache contains data, the development environment console displays the number of cached dictionary elements.
See also: