Clear;
The Clear method deletes all data sources of the regular report.
Executing the example requires a regular report with the REGULAR_REPORT identifier that contains data sources. Add links to the Metabase, Report system assemblies.
Sub Main;
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;
DtSources.Clear;
MObj.Save;
End Sub Main;
After executing the example all data sources will be deleted from regular report.
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;
DtSources.Clear();
MObj.Save();
End Sub;
See also: