Count: Integer;
The Count property returns the number of data sources.
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.
See also: