SaveCache(
DestKey: Integer;
ParamValues: IMetabaseObjectParamValues;
Selections: IDimSelectionSet;
Value: IMatrix);
SaveCache(
DestKey: UInteger;
ParamValues: Prognoz.Platform.Interop.Metabase.IMetabaseObjectParamValues;
Selections: Prognoz.Platform.Interop.Dimensions.IDimSelectionSet;
Value: Prognoz.Platform.Interop.Matrix.IMatrix);
DestKey. The key of the required cube display version.
ParamValues. Parameters of the specified caching object.
Selections. The collection of selections in the specified cube display version.
Value. Matrix of cube values.
The SaveCache method saves cache for the cube display version by the specified parameters.
Executing the example requires a database with the DB identifier and a cube with the D_SEP identifier.
Sub UserProc;
Var
MB: IMetabase;
MObj: IMetabaseObjectDescriptor;
CacheSaver: ICubeCacheSaver;
CrInfo: IMetabaseObjectCreateInfo;
CubIn: ICubeInstance;
Dest: ICubeInstanceDestination;
SelSet: IDimSelectionSet;
i: Integer;
Sel: IDimSelection;
Mat: IMatrix;
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;
CubIn := MObj.Open(Null) As ICubeInstance;
Dest := CubIn.Destinations.DefaultDestination;
SelSet := Dest.CreateDimSelectionSet;
For Each Sel In SelSet Do
Sel.SelectAll;
End For;
Mat := Dest.Execute(SelSet);
CacheSaver.SaveCache(Dest.Key, Null, SelSet, Mat);
End Sub UserProc;
After executing the example the cache storage for the cube with the D_SEP identifier will be created in the database with the DB identifier.
Executing the example requires a database with the DB identifier and a cube with the D_SEP identifier.
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Db;
Imports Prognoz.Platform.Interop.Dimensions;
Imports Prognoz.Platform.Interop.Matrix;
Public Sub Main(Params: StartParams);
Var
MB: IMetabase;
MObj: IMetabaseObjectDescriptor;
CacheSaver: ICubeCacheSaver;
CrInfo: IMetabaseObjectCreateInfo;
CubIn: ICubeInstance;
Dest: ICubeInstanceDestination;
SelSet: IDimSelectionSet;
i: Integer;
Sel: IDimSelection;
Mat: IMatrix;
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();
CubIn := MObj.Open(Null) As ICubeInstance;
Dest := CubIn.Destinations.DefaultDestination;
SelSet := Dest.CreateDimSelectionSet();
For Each Sel In SelSet Do
Sel.SelectAll();
End For;
Mat := Dest.Execute(SelSet, UInteger.MaxValue);
CacheSaver.SaveCache(Dest.Key, Null, SelSet, Mat);
End Sub;
After executing the example the cache storage of the cache for the cube with the D_SEP identifier will be created in the database with the DB identifier.
See also: