IPivot.Matrix

Fore Syntax

Matrix: IMatrix;

Fore.NET Syntax

Matrix: Prognoz.Platform.Interop.Matrix.IMatrix;

Description

The Matrix property returns table data as a matrix.

Comments

A data matrix is a set of data presented in numeric format and including rows and columns.

Fore Example

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:

Fore.NET Example

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:

IPivot