SaveCacheCustom(
DestKey: Integer;
ParamValues: IMetabaseObjectParamValues;
Selections: IDimSelectionSet;
Value: IMatrix;
CustomValue: Variant);
DestKey. The key of the required cube display version.
ParamValues. Parameter values set.
Selections. Dimension selection in the specified cube display version.
Value. Matrix of cube values.
CustomValue. Custom label for indicating saved data.
The SaveCacheCustom method saves cache according to the specified parameters and specified custom label.
Executing the example requires a standard cube with the STD_CUBE identifier.
Add links to the Cubes, Dimensions, Matrix, Metabase system assemblies.
Sub UserProc;
Var
MB: IMetabase;
MDesc, CacheDesc: IMetabaseObjectDescriptor;
CacheSaver: ICubeCacheSaver;
CubeInst: ICubeInstance;
Dest: ICubeInstanceDestination;
SelSet: IDimSelectionSet;
Sel: IDimSelection;
Matr: IMatrix;
Begin
MB := MetabaseClass.Active;
MDesc := MB.ItemById("STD_CUBE");
CacheDesc := GetCache(MDesc);
If CacheDesc <> Null Then
CacheSaver := CacheDesc.Bind As ICubeCacheSaver;
CubeInst := MDesc.Open(Null) As ICubeInstance;
Dest := CubeInst.Destinations.DefaultDestination;
SelSet := Dest.CreateDimSelectionSet;
For Each Sel In SelSet Do
If Sel.Dimension.Ident = "FACTS" Then
Sel.SelectElement(0, False);
Else
Sel.SelectAll;
End If;
End For;
Matr := Dest.Execute(SelSet);
CacheSaver.SaveCacheCustom(Dest.Key, Null, SelSet, Matr, "Date Save: " + DateTime.Today.ToString);
End If;
End Sub UserProc;
Function GetCache(MObj: IMetabaseObjectDescriptor): IMetabaseObjectDescriptor;
Var
Desc: IMetabaseObjectDescriptor;
Begin
For Each Desc In MObj.Children Do
If Desc.ClassId = MetabaseObjectClass.KE_CLASS_CUBE_CACHE_SAVER Then
Return Desc;
End If;
End For;
Return Null;
End Function GetCache;
After executing the example the cube is will be calculated by the created label. After the calculation the obtained data matrix will be saved to cache.
See also: