IPrxDataSources.Count

Syntax

Count: Integer;

Description

The Count property returns the number of data sources.

Fore Example

Executing the example requires a regular report with the REGULAR_REPORT identifier that contains data sources. Add links to the Metabase, Report system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    Report: IPrxReport;
    DtSources: IPrxDataSources;
    DtSource: IPrxDataSource;
    Name: String;
    i: Integer;
Begin
    MB := MetabaseClass.Active;
    Report := MB.ItemById("REGULAR_REPORT").Bind As IPrxReport;
    DtSources := Report.DataSources;
    i := DtSources.Count;
    DtSource := DtSources.Item(0);
    Name := DtSource.Name;
    Debug.WriteLine(i);
    Debug.WriteLine(Name);
    Debug.WriteLine(DtSources.Report.Name);
End Sub UserProc;

After executing the example the console displays the number of data sources, name of the first data source, name of the regular report.

Fore.NET Example

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

Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Report;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    Report: IPrxReport;
    DtSources: IPrxDataSources;
    DtSource: IPrxDataSource;
    Name: String;
    i: Integer;
Begin
    MB := Params.Metabase;
    Report := MB.ItemById["REGULAR_REPORT"].Bind() As IPrxReport;
    DtSources := Report.DataSources;
    i := DtSources.Count;
    DtSource := DtSources.Item[0];
    Name := DtSource.Name;
    System.Diagnostics.Debug.WriteLine(i);
    System.Diagnostics.Debug.WriteLine(Name);
    System.Diagnostics.Debug.WriteLine(DtSources.Report.Name);
End Sub;

See also:

IPrxDataSources