IsLinked: Boolean;
The IsLinked property returns whether a data source is linked.
Linked data sources are data sources for blocks of the Express Report, Regular Report or Dashboard type.
Available values:
True. A data source is linked.
False. A data source is not linked.
Executing the example requires that the repository contains a dashboard with the DASHBOARD_F identifier and an express report with the EXP_F identifier.
Add links to the Adhoc, Express, Metabase system assemblies.
Sub UserProc;
Var
MB: IMetabase;
MObj, Mbod: IMetabaseObject;
Sourse: IEaxAnalyzer;
Dashboard, Db: IAdhocReport;
DbSources: IAdhocDataSourceObjects;
DbSource: IAdhocDataSourceObject;
Begin
// Get the current repository
MB := MetabaseClass.Active;
// Get dashboard
MObj := MB.ItemById("DASHBOARD_F").Edit;
Dashboard := MObj As IAdhocReport;
// Get dashboard data sources
DbSources := Dashboard.DataSourceObjects;
DbSources.RemoveById("EXP_F");
//Add a new data source
Mbod := MB.ItemById("EXP_F") As IMetabaseObject;
Dashboard.AddDataSourceObject("EXP_F", Mbod.Edit);
// Refresh source metadata
DbSource := DbSources.Item(0);
Dashboard.RefreshDataSources(DbSource);
// Display whether the connection is established
Debug.WriteLine("Is a source linked: " + DbSources.IsLinked.ToString);
// Display source name
Sourse := DbSource.GetSourceObject As IEaxAnalyzer;
Debug.WriteLine("Source name: " + Sourse.Name);
// Display parent name
Db := DbSources.Report;
Debug.WriteLine("Active report slide identifier: " + Db.ActiveSlide.Id);
// Save dashboard
MObj.Save;
End Sub UserProc;
After executing the example the console window displays whether a source is linked, source name, and active report slide identifier. An express report is added to the dashboard as a data source, and source metadata is refreshed.
See also: