IPrxDataSources.FindByKey

Syntax

FindByKey(Key: Integer): IPrxDataSource;

Parameters

Key. Key of data source used for search.

Description

The FindByKey method searches for and returns an object containing a data source.

Comment

The range of keys is used inside the IPrxDataSources collection where each data source is allocated to the key starting with one.

Example

Executing the example requires a regular report with the REGULAR_REPORT identifier that contains data sources. One of the keys has the 1 key. 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.FindByKey(1);
    For Each Slice In DtSource.Slices Do
        Debug.WriteLine(Slice.Name)
    End For;
End Sub UserProc;

After executing the example the console displays slice names contained in the cube with the 1 key.

See also:

IPrxDataSources