Matrix: IMatrix;
Matrix: Prognoz.Platform.Interop.Matrix.IMatrix;
The Matrix property returns table data as a matrix.
A data matrix is a set of data presented in numeric format and including rows and columns.
Executing the example requires that the repository contains an express report with the EXPRESS_PIVOT identifier. The report contains a table.
Add links to the Dimensions, Express, Matrix, Metabase, Pivot system assemblies.
Sub UserProc;
Var
MB: IMetabase;
DimSelectionSet: IDimSelectionSet;
Analyzer: IEaxAnalyzer;
Pivot: IPivot;
PivotMatrix: IMatrix;
DimCount: Integer;
Begin
// Get repository
MB := MetabaseClass.Active;
// Get express report
Analyzer := MB.ItemById("EXPRESS_IPIVOT").Bind As IEaxAnalyzer;
// Get express report data table
Pivot := Analyzer.Pivot;
// Get dimension selection, by which the table is built
DimSelectionSet := Pivot.Selection;
// Select all selection elements
DimSelectionSet.Item(0).SelectAll;
// Get table data as a matrix
PivotMatrix := Pivot.Matrix;
// Set value in the matrix by dimension selection
PivotMatrix.SetValueBySelection(DimSelectionSet, 10);
// Get the number of matrix dimensions
DimCount := PivotMatrix.DimensionCount;
// Display in the console window
Debug.WriteLine("Number of matrix dimensions = " + DimCount.ToString);
End Sub UserProc;
After executing the example:
Data matrix is filled with values by the dimension selection, by which the table is built.
The console window displays the number of matrix dimensions.
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.Matrix;
Imports Prognoz.Platform.Interop.Pivot;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
DimSelectionSet: IDimSelectionSet;
Analyzer: IEaxAnalyzer;
Pivot: IPivot;
PivotMatrix: IMatrix;
DimCount: Integer;
Begin
// Get repository
MB := Params.Metabase;
// Get express report
Analyzer := MB.ItemById["EXPRESS_IPIVOT"].Bind() As IEaxAnalyzer;
// Get express report data table
Pivot := Analyzer.Pivot;
// Get dimension selection, by which the table is built
DimSelectionSet := Pivot.Selection;
// Select all selection elements
DimSelectionSet.Item[0].SelectAll();
// Get table data as a matrix
PivotMatrix := Pivot.Matrix;
// Set value in the matrix by dimension selection
PivotMatrix.SetValueBySelection(DimSelectionSet, 10);
// Get the number of matrix dimensions
DimCount := PivotMatrix.DimensionCount;
// Display in the console window
System.Diagnostics.Debug.WriteLine
("Number of matrix dimensions = " + DimCount.ToString);
End Sub;
See also: