CreateDataSourceCache(Database: IMetabaseObjectDescriptor): Boolean;
Database. Repository database, to which cached data will be saved.
The CreateDataSourceCache method creates a caching object of express report data source and returns result of its creation.
After executing the CreateDataSourceCache method, execute the IEaxAnalyzeCore.RefreshDataSourceCache method.
The method returns the result of caching object creation operation:
True. Caching object is successfully created.
False. Caching object is not created.
Executing the example requires an express report with the EXPRESS_REPORT 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("EXPRESS_REPORT").Edit As IEaxAnalyzer;
Eax.ClearDataSourceCache;
Debug.WriteLine("Created: " + Eax.CreateDataSourceCache(Desc).ToString);
Eax.RefreshDataSourceCache;
Debug.WriteLine("Indicates whether caching object exists: " + Eax.IsDataSourceCacheExist.ToString);
Debug.WriteLine("Source cube name: " + Eax.DataSourceCache.Parent.Name);
End Sub Button1OnClick;
After executing the example a caching object is created for the express report source in the database with the DB identifier. The console window shows result of creating a caching object, result of checking if the cache object exists, and name of source cube.
See also: