IPrxDataIsland.Revert

Fore Syntax

Revert;

Fore.NET Syntax

Revert();

Description

The Revert method cancels changes made in the data area.

Comments

Changes can be cancelled only for the data area, which is started to be edited using the IPrxDataIsland.Edit method.

Fore Example

Executing the example requires that repository contains a regular report including data area with the REPORT_IPRXDATAISLAND identifier.

Add links to the Metabase, Report system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    MObj: IMetabaseObject;
    DI: IPrxDataIsland;
    Report: IPrxReport;
Begin
    // Get repository
    MB := MetabaseClass.Active;
    // Get regular report
    MObj := MB.ItemById("REPORT_IPRXDATAISLAND").Edit;
    Report := MObj As IPrxReport;
    DI := Report.DataIslands.Item(0).Edit;
    // Change name
    DI.Name := "DI";
    // Display a new name in the console window
    Debug.WriteLine(DI.Name);
    // Cancel name changes
    DI.Revert;
    // Display previous name to the console window and save
    Debug.WriteLine(DI.Name);
    DI.Save;
    // Save report
    MObj.Save;
End Sub UserProc;

After executing the example the console window displays a new name of data area and next the name after renaming cancelation.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.Report;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    MObj: IMetabaseObject;
    DI: IPrxDataIsland;
    Report: IPrxReport;
Begin
    
// Get repository
    MB := Params.Metabase;
    
// Get regular report
    MObj := MB.ItemById["REPORT_IPRXDATAISLAND"].Edit();
    Report := MObj 
As IPrxReport;
    DI := Report.DataIslands.Item[
0].Edit();
    
// Change name
    DI.Name := "DI";
    
// Display a new name in the console window
    System.Diagnostics.Debug.WriteLine(DI.Name);
    
// Cancel name change
    DI.Revert();
    
// Display previous name in the console window and save
    System.Diagnostics.Debug.WriteLine(DI.Name);
    DI.Save();
    
// Save report  
    MObj.Save();
End Sub;

See also:

IPrxDataIsland