IPrxDataSources.Remove

Fore Syntax

Remove(Index: Integer): Boolean;

Fore.NET Syntax

Remove(Index: integer): boolean;

Parameters

Index. Data source index.

Description

The Remove method removes data source by its index.

Comments

The method returns True in case of successful removal.

Fore Example

Executing the example requires a regular report with the REGULAR_REPORT identifier.

Add links to the Metabase, Report system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    MObj: IMetabaseObject;
    Report: IPrxReport;
    DtSources: IPrxDataSources;
Begin
    MB := MetabaseClass.Active;
    MObj := MB.ItemById("REGULAR_REPORT").Edit;
    Report := MObj As IPrxReport;
    DtSources := Report.DataSources;
    If DtSources.Remove(0Then
        Debug.WriteLine("Remove");
        Else Debug.WriteLine("Don't remove");
    End If;
    MObj.Save;
End Sub UserProc;

After executing the example the console window displays the message whether the selected data source is removed.

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;
Begin
    MB := Params.Metabase;
    MObj := MB.ItemById["REGULAR_REPORT"].Edit();
    Report := MObj As IPrxReport;
    DtSources := Report.DataSources;
    If DtSources.Remove(0Then
        System.Diagnostics.Debug.WriteLine("Remove");
        Else System.Diagnostics.Debug.WriteLine("Don't remove");
    End If;
    MObj.Save();
End Sub;

See also:

IPrxDataSources