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 IEaxAnalyzer.RefreshDataSourceCache method.
The method returns 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.
This 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 shows result of creating a cache object, result of checking whether 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: