CreateDataSourceCache(Database: IMetabaseObjectDescriptor): Boolean;
CreateDataSourceCache(Database: Prognoz.Platform.Interop.Metabase.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 IEaxAnalyzerCore.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.
The requirements and result of the Fore.NET example execution match with those in the Fore example. Use Fore.NET analogs instead of Fore components.
Imports Prognoz.Platform.Interop.Express;
…
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
MB: IMetabase;
Desc: IMetabaseObjectDescriptor;
Eax: IEaxAnalyzer;
Begin
MB := Self.Metabase;
Desc := MB.ItemById["DB"];
Eax := MB.ItemById["Eax"].Edit() As IEaxAnalyzer;
Eax.ClearDataSourceCache();
System.Diagnostics.Debug.WriteLine("Created: " + Eax.CreateDataSourceCache(Desc).ToString());
Eax.RefreshDataSourceCache();
System.Diagnostics.Debug.WriteLine("If there is cache object: " + Eax.IsDataSourceCacheExist.ToString());
System.Diagnostics.Debug.WriteLine("Source cube name: " + Eax.DataSourceCache.Parent.Name);
End Sub;
See also: