Remove(Index: Integer): Boolean;
Remove(Index: integer): boolean;
Index. Data source index.
The Remove method removes data source by its index.
The method returns True in case of successful removal.
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(0) Then
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.
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(0) Then
System.Diagnostics.Debug.WriteLine("Remove");
Else System.Diagnostics.Debug.WriteLine("Don't remove");
End If;
MObj.Save();
End Sub;
See also: