IPrxDataSources.FindById

Syntax

FindById(Id: String): IPrxDataSource;

Parameters

Id. Identifier of searched data source.

Description

The FindById method searches for a regular report data source by identifier.

Comments

The search is executed by the identifier, which was set for repository object.

Fore Example

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

Sub UserProc;
Var
    MB: IMetabase;
    MObj: IMetabaseObject;
    Report: IPrxReport;
    DtSources: IPrxDataSources;
    DtSource: IPrxDataSource;
    Slice: IPrxSlice;
Begin
    MB := MetabaseClass.Active;
    MObj := MB.ItemById("REGULAR_REPORT").Bind;
    Report := MObj As IPrxReport;
    DtSources := Report.DataSources;
    DtSource := Report.DataSources.FindById("CUBE");
    For Each Slice In DtSource.Slices Do
        Debug.WriteLine(Slice.Name)
    End For;
End Sub UserProc;

After executing the example the console displays names of slices, which are included into the cube with the CUBE identifier.

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;
    MObj: IMetabaseObject;
    Report: IPrxReport;
    DtSources: IPrxDataSources;
    DtSource: IPrxDataSource;
    Slice: IPrxSlice;
Begin
    MB := Params.Metabase;
    MObj := MB.ItemById["REGULAR_REPORT"].Bind();
    Report := MObj As IPrxReport;
    DtSources := Report.DataSources;
    DtSource := Report.DataSources.FindById("CUBE");
    For Each Slice In DtSource.Slices Do
        System.Diagnostics.Debug.WriteLine(Slice.Name)
    End For;
End Sub;

See also:

IPrxDataSources