Equal(Other: IEaxDimensionDescriptor): Boolean;
Equal(Other: Prognoz.Platform.Interop.Express.IEaxDimensionDescriptor): boolean;
Other. Dimension description which is being compared.
The Equal method compare dimension description with another description.
Returned values:
True. Dimension descriptions are equal.
False. Dimension descriptions are not equal.
Executing the example requires that the repository contains an express report with the EXPRESS identifier containing table.
Add links to the Dimensions, Express, Metabase, Pivot system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Analyzer: IEaxAnalyzer;
DA: IEaxDataArea;
Slice, SliceDim: IEaxDataAreaSlice;
PivotDimKey, PivotDimKeyTwo: Integer;
DimensionInst, DimensionInstTwo: IEaxDimensionInstance;
DimDescr, DimDescrTwo: IEaxDimensionDescriptor;
Begin
// Get repository
MB := MetabaseClass.Active;
// Get express report
Analyzer := MB.ItemById("EXPRESS").Edit As IEaxAnalyzer;
// Get data area
DA := Analyzer.DataArea;
// Get data slice
Slice := DA.Slices.Item(0);
// Get dimension key
PivotDimKey := Analyzer.Pivot.DimItem(3).Key;
// Get dimension data by key
DimensionInst := Slice.GetDimension(PivotDimKey);
// Display to the console selection elements and dimension name
Debug.WriteLine("Selection elements - " + DimensionInst.Selection.ToString("", ", ", False));
Debug.WriteLine("Dimension name - " + DimensionInst.Dimension.Name);
// Get dimension description
DimDescr := DimensionInst As IEaxDimensionDescriptor;
// Display to the console dimension key
Debug.WriteLine("Dimension key - " + DimDescr.DimKey.ToString);
// Get slice to which dimension belongs
SliceDim := DimDescr.Slice As IEaxDataAreaSlice;
// Display to the console identifier of data slice
Debug.WriteLine("Identifier of data slice - " + SliceDim.Id);
// Display to the console type of dimension parent object
Select Case DimDescr.SliceType As Integer
Case 0: Debug.WriteLine("Type of dimension parent object - PivotSlice");
Case 1: Debug.WriteLine("Type of dimension parent object - PrxSlice");
Case 2: Debug.WriteLine("Type of dimension parent object - Visualizer");
End Select;
// Get dimension description
PivotDimKeyTwo := Analyzer.Pivot.DimItem(4).Key;
DimensionInstTwo := Slice.GetDimension(PivotDimKeyTwo);
DimDescrTwo := DimensionInstTwo As IEaxDimensionDescriptor;
// Display to the console attribute of dimension description equality
If DimDescr.Equal(DimDescrTwo) Then
Debug.WriteLine("Dimension descriptions are equal");
Else
Debug.WriteLine("Dimension descriptions are not equal");
End If;
End Sub UserProc;
After executing the example the console window displays:
Elements of dimension selection.
Dimension name.
Dimension key.
Identifier of data slice where specified dimension is located.
Dimension parent object type.
Matching result of two description of dimension.
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.Express;
Imports Prognoz.Platform.Interop.Pivot;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
Analyzer: IEaxAnalyzer;
DA: IEaxDataArea;
Slice, SliceDim: IEaxDataAreaSlice;
PivotDimKey, PivotDimKeyTwo: uinteger;
DimensionInst, DimensionInstTwo: IEaxDimensionInstance;
DimDescr, DimDescrTwo: IEaxDimensionDescriptor;
Begin
// Get repository
MB := Params.Metabase;
// Get express report
Analyzer := MB.ItemById["EXPRESS"].Bind() As IEaxAnalyzer;
// Get data area
DA := Analyzer.DataArea;
// Get data slice
Slice := DA.Slices.Item[0];
// Get dimension key
PivotDimKey := Analyzer.Pivot.DimItem[3].Key;
// Get dimension data by key
DimensionInst := Slice.GetDimension(PivotDimKey);
// Display to the console selection elements and dimension name
System.Diagnostics.Debug.WriteLine("Selection elements - " + DimensionInst.Selection.ToString("", ", ", False));
System.Diagnostics.Debug.WriteLine("Dimension names - " + DimensionInst.Dimension.Name);
// Get dimension description
DimDescr := DimensionInst As IEaxDimensionDescriptor;
// Display to the console dimension key
System.Diagnostics.Debug.WriteLine("Dimension key - " + DimDescr.DimKey.ToString());
// Get slice to which dimension belongs
SliceDim := DimDescr.Slice As IEaxDataAreaSlice;
// Display to the console identifier of data slice
System.Diagnostics.Debug.WriteLine("Data slice identifier - " + SliceDim.Id);
// Display to the console type of dimension parent object
Select Case DimDescr.SliceType As Integer
Case 0: System.Diagnostics.Debug.WriteLine("Type of dimension parent object - PivotSlice");
Case 1: System.Diagnostics.Debug.WriteLine("Type of dimension parent object - PrxSlice");
Case 2: System.Diagnostics.Debug.WriteLine("Type of dimension parent object - Visualizer");
End Select;
// Get dimension description
PivotDimKeyTwo := Analyzer.Pivot.DimItem[4].Key;
DimensionInstTwo := Slice.GetDimension(PivotDimKeyTwo);
DimDescrTwo := DimensionInstTwo As IEaxDimensionDescriptor;
// Display to the console attribute of dimension description equality
If DimDescr.Equal(DimDescrTwo) Then
System.Diagnostics.Debug.WriteLine("Dimension descriptions are equal");
Else
System.Diagnostics.Debug.WriteLine("Dimension descriptions are not equal");
End If;
End Sub;
See also: