ILanerContext.FindSerieByStubKey

Syntax

FindSerieByStubKey(StubKey: Integer): ILanerSerie;

Parameters

StubKey. Data source key.

Description

The FindSerieByStubKey method searches a series in the context by data source key.

Comments

If a series is not found, the method returns Null.

Example

Executing the example requires a form containing:

There should also be the pContext variable that contains context.

Add links to the Metabase and the Cubes system assemblies. Example is a handler of the OnClick event for the button.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    pContext: ILanerContext;
    i: Integer;
    Ser: ILanerCalculateSerie;
    Stub: IVariableStub;
    lSerie: ILanerSerie;
Begin
    For i := 0 To LanerBox1.SelectedSeriesCount - 1 Do
        Ser := LanerBox1.SelectedSeries(i) As ILanerCalculateSerie;
        Stub := Ser.Stub;
        lSerie := pContext.FindSerieByStubKey(Stub.Key);
        If lSerie <> Null Then
            Debug.WriteLine(Stub.NameEx(True));
        End If;
    End For;
End Sub Button1OnClick;

After executing the example, extended series names, highlighted in the LanerBox1 component and present in the context, are displayed in a console window.

See also:

ILanerContext