IInMemManager.PrepareMatrix

Syntax

PrepareMatrix(Dest: ICubeInstanceDestination): IMatrix;

PrepareMatrix(Dest: Prognoz.Platform.Interop.Cubes.ICubeInstanceDestination): Prognoz.Platform.Interop.Matrix.IMatrix;

Parameters

Dest. Built cube display version.

Description

The PrepareMatrix method builds matrix that will be saved to the cache for the specified cube display option.

Comments

If cache contains already cached matrix with data for the specified cube display version, it will be rebuilt. Because of implementation particularity, the method returns empty matrix which structure corresponds to data source structure.

Example

Executing the example requires that the repository contains a cube with the STD_CUBE identifier. The repository uses In-Memory caching mechanism.

Add links to the Cubes and Metabase system assemblies.

Sub UserProc;
Var
    Mb: IMetabase;
    CubeInst: ICubeInstance;
    DestInst: ICubeInstanceDestination;
    InMem: IInMemManager;
Begin
    Mb := MetabaseClass.Active;
    
// Open cube
    CubeInst := Mb.ItemById("STD_CUBE").Open(NullAs ICubeInstance;
    DestInst := CubeInst.Destinations.DefaultDestination;
    
// Manager to work with In-Memory cache
    InMem := New InMemManager.Create;
    InMem.PrepareMatrix(DestInst);
End Sub UserProc;

Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Metabase;

Public Shared Sub Main(Params: StartParams);
Var
    Mb: IMetabase;
    CubeInst: ICubeInstance;
    DestInst: ICubeInstanceDestination;
    InMem: InMemManager = 
New InMemManagerClass();
Begin
    Mb := Params.Metabase;
    
// Open cube
    CubeInst := Mb.ItemById["STD_CUBE"].Open(NullAs ICubeInstance;
    DestInst := CubeInst.Destinations.DefaultDestination;
    
// Manager to work with In-Memory cache
    InMem.PrepareMatrix(DestInst);
End Sub;

On executing the example the cache updates all data of the specified cube.

See also:

IInMemManager