IMetabaseObjectCopyInfo.NoSaveEvent

Syntax

NoSaveEvent: Boolean;

NoSaveEvent: boolean;

Description

The NoSaveEvent property determines whether it is possible to cancel the IPrxReportUserEvents.EventOnBeforeSaveReport event on coping the report.

Comments

Available values:

Example

Executing the example requires that a repository contains a report with the PROC_REPORT_SRC identifier with connected unit as event handler with the IPrxReportUserEvents.EventOnBeforeSaveReport event.

Add links to the Metabase and Report system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    CInfo: IMetabaseObjectCopyInfo;
    MObj: IMetabaseObject;
    Rep: IPrxReport;
Begin
    
// Get current repository
    MB := MetabaseClass.Active;
    
// Create object to copy and set parameters
    CInfo := MB.CreateCopyInfo;
    CInfo.Id := MB.GenerateId(
"PROC_REPORT_SRC_1");
    CInfo.Name := 
"Report";
    CInfo.Destination := MB.Root;
    CInfo.Source := MB.ItemById(
"PROC_REPORT_SRC");
    CInfo.NoSave := 
True;
    CInfo.NoSaveEvent := 
True;
    
// Copy
    MB.CopyObject(CInfo);
    MObj := CInfo.Destination 
As IMetabaseObject;
    
// Add a table sheet to the report copy
    Rep := MObj As IPrxReport;
    Rep.Sheets.Add(
"Sheet_1");
    
// Save report
    MObj.Save;
End Sub UserProc;

Imports Prognoz.Platform.Interop.Report;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    CInfo: IMetabaseObjectCopyInfo;
    MObj: IMetabaseObject;
    Rep: IPrxReport;
Begin
    // Get current repository
    MB := Params.Metabase;
    
// Create object to copy and set parameters
    CInfo := MB.CreateCopyInfo();
    CInfo.Id := MB.GenerateId(
"PROC_REPORT_SRC_1"0);
    CInfo.Name := 
"Report";
    CInfo.Destination := MB.Root;
    CInfo.Source := MB.ItemById[
"PROC_REPORT_SRC"];
    CInfo.NoSave := 
True;
    CInfo.NoSaveEvent := 
True;
    
// Copy
    MB.CopyObject(CInfo);
    MObj := CInfo.Destination 
As IMetabaseObject;
    
// Add a table sheet to the report copy
    Rep := MObj As IPrxReport;
    Rep.Sheets.Add(
"Sheet_1", PrxSheetType.pstTable);
    
// Save report
    MObj.Save();
End Sub;

After executing the example the report is copied to the repository root folder. To the obtained report copy, before saving, the table sheet will be added. The IPrxReportUserEvents.EventOnBeforeSaveReport event will not be generated.

See also:

IMetabaseObjectCopyInfo