ICubeCacheSaver.SaveCube

Fore Syntax

SaveCube(Cube: IMetabaseObject);

Fore.NET Syntax

SaveCube(Cube: Prognoz.Platform.Interop.Metabase.IMetabaseObject);

Parameters

Cube. The cube, which cache must be saved.

Description

The SaveCache method saves cache for the specified variant of cube layout by the specified parameters.

Fore Example

Executing the example requires a cube with the D_SEP identifier and a database with the DB identifier. The cube must have the possibility for data caching.

Sub UserProc;
Var
    MB: IMetabase;
    MObj: IMetabaseObjectDescriptor;
    CacheSaver: ICubeCacheSaver;
    CrInfo: IMetabaseObjectCreateInfo;
Begin
    MB := MetabaseClass.Active;
    MObj := MB.ItemById("D_SEP");
    CrInfo := MB.CreateCreateInfo;
    CrInfo.ClassId := MetabaseObjectClass.KE_CLASS_CUBE_CACHE_SAVER;
    CrInfo.Parent := MObj;
    CrInfo.Permanent := True;
    CacheSaver := MB.CreateObject(CrInfo).Edit As ICubeCacheSaver;
    CacheSaver.Database := MB.ItemById("DB").Bind As IDatabase;
    (CacheSaver As IMetabaseObject).Save;
    CacheSaver.SaveCube(MObj.Bind);
End Sub UserProc;

After executing the example cube data will be cached with default parameters.

Fore.NET Example

Executing the example requires a cube with the D_SEP identifier and a database with the DB identifier. The cube must have the possibility for data caching.

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

Public Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    MObj: IMetabaseObjectDescriptor;
    CacheSaver: ICubeCacheSaver;
    CrInfo: IMetabaseObjectCreateInfo;
Begin
    MB := Params.Metabase;
    MObj := MB.ItemById["D_SEP"];
    CrInfo := MB.CreateCreateInfo();
    CrInfo.ClassId := MetabaseObjectClass.KE_CLASS_CUBE_CACHE_SAVER As Int32;
    CrInfo.Parent := MObj;
    CrInfo.Permanent := True;
    CacheSaver := MB.CreateObject(CrInfo).Edit() As ICubeCacheSaver;
    CacheSaver.Database := MB.ItemById["DB"].Bind() As IDatabase;
    (CacheSaver As IMetabaseObject).Save();
    CacheSaver.SaveCube(MObj.Bind());
End Sub;

After executing the example cube data will be cached with default parameters.

See also:

ICubeCacheSaver