IAdhocDataSourceObjects.IsLinked

Fore Syntax

IsLinked: Boolean;

Fore.NET Syntax

IsLinked: boolean;

Description

The IsLinked property returns whether a data source is linked.

Comments

Linked data sources are data sources for blocks of the Express Report, Regular Report or Dashboard type.

Available values:

Fore Example

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.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.Adhoc;
Imports Prognoz.Platform.Interop.Express;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    MObj, Mbod: IMetabaseObject;
    Sourse: IEaxAnalyzer;
    Dashboard, Db: IAdhocReport;
    DbSources: IAdhocDataSourceObjects;
    DbSource: IAdhocDataSourceObject;
Begin
    // Get the current repository
    MB := Params.Metabase;
    // Get dashboard
    MObj := MB.ItemById["DASHBOARD_F"].Edit();
    Dashboard := MObj As IAdhocReport;
    // Get data sources of the dashboard
    DbSources := Dashboard.DataSourceObjects;
    DbSources.RemoveById("EXP_F");
    //Add a new data source
    Mbod := MB.ItemById["EXP_F"As IMetabaseObject;
    Dashboard.AddDataSourceObject("EXP_F", Mbod);
    // Refresh source metadata
    DbSource := DbSources.Item[0];
    Dashboard.RefreshDataSources(DbSource);
    // Display whether the connection is established
    System.Diagnostics.Debug.WriteLine("Is source linked: " + DbSources.IsLinked.ToString());
    // Display source name
    Sourse := DbSource.GetSourceObject() As IEaxAnalyzer;
    System.Diagnostics.Debug.WriteLine("Source name: " + Sourse.Name);
    // Display parent name
    Db := DbSources.Report;
    System.Diagnostics.Debug.WriteLine("Active report slide identifier: " + Db.ActiveSlide.Id);
    // Save dashboard
    MObj.Save();
End Sub;

See also:

IAdhocDataSourceObjects