ILanerContext.FindSerieByStubKey

Fore Syntax

FindSerieByStubKey(StubKey: Integer): ILanerSerie;

Fore.NET Syntax

FindSerieByStubKey(StubKey: integer): Prognoz.Platform.Interop.Laner.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.

Fore 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.

Fore.NET Example

Executing the example requires a .NET form containing:

Example is a handler of the Click event for the button.

Imports Prognoz.Platform.Interop.Laner;
Imports Prognoz.Platform.Interop.Cubes;

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    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 := GlobalContext.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