CreateDataSourceCache(Database: IMetabaseObjectDescriptor): Boolean;
Database. Repository database, to which cached data is saved.
The CreateDataSourceCache method creates a cache object of the data source of express report and returns result of its creation.
After executing the CreateDataSourceCache method, execute the IEaxAnalyzeCore.RefreshDataSourceCache method.
The method returns the result of operation on creating of cache object:
True. Cache object is successfully created.
False. Cache object is not created.
Executing the example requires an express report with the Eax identifier and a form containing a button with the Button1 identifier.
Add links to the Express and Metabase system assemblies.
The example is a handler of the OnClick event for the Button1 component.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
MB: IMetabase;
Desc: IMetabaseObjectDescriptor;
Eax: IEaxAnalyzer;
Begin
MB := MetabaseClass.Active;
Desc := MB.ItemById("DB");
Eax := MB.ItemById("Eax").Edit As IEaxAnalyzer;
Eax.ClearDataSourceCache;
Debug.WriteLine("Created: " + Eax.CreateDataSourceCache(Desc).ToString);
Eax.RefreshDataSourceCache;
Debug.WriteLine("If there is cache object: " + Eax.IsDataSourceCacheExist.ToString);
Debug.WriteLine("Source cube name: " + Eax.DataSourceCache.Parent.Name);
End Sub Button1OnClick;
After executing the example a cache object is created for the express report source in the database with the DB identifier. The console window displays result of creating a cache object, result of checking if the cache object exists, and name of source cube.
See also: