IEaxAnalyzerOptions.UseSharedEventHandler

Syntax

UseSharedEventHandler: Boolean;

Description

The UseSharedEventHandler property determines whether express report uses event handler.

Comments

Available values:

Example

Executing the example requires that the repository contains an express report with the EXPRESS_EVENTHANDLER identifier.

The repository must also contain an event handler unit with the EXPRESSREPEVENTS identifier that contains the ExpressEvents class used to implement events. The class description is given in the example for IEaxAnalyzerUserEvents.OnAfterExecuteAnalyzer.

Add links to the Express, Fore, Metabase system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    Analyzer: IEaxAnalyzer;
    Options: IEaxAnalyzerOptions;
    SParams: ISharedParams;
    ShPar: IMetabaseObjectDescriptor;
    EventHandlers: ISharedEventHandlers;
    EventHandler: ISharedEventHandler;
Begin
    // Get repository
    MB := MetabaseClass.Active;
    // Get global variable area
    ShPar := MB.SpecialObject(MetabaseSpecialObject.SharedParams);
    // Get repository parameters
    SParams := Shpar.Edit As ISharedParams;
    // Get object used to work with report event handler
    EventHandlers := SParams.EventHandlers;
    // Use the report event handler
    EventHandlers.Enabled := True;
    // Get and activate the express report event handler
    EventHandler := EventHandlers.EventHandler(SharedEventHandlerType.ExpressReport);
    EventHandler.Enabled := True;
    // Connect the event handler
    EventHandler.Object := MB.ItemById("EXPRESSREPEVENTS");
    // Set module class
    EventHandler.EventsClass := "ExpressRep_Events";
    // Save changes in repository parameters
    (SParams As ImetabaseObject).Save;
    // Get express report
    Analyzer := MB.ItemById("EXPRESS_EVENTHANDLER").Edit As IEaxAnalyzer;
    // Get report parameters
    Options := Analyzer.Options;
    // Use the event handler
    If Options.UseSharedEventHandler = False Then
        Options.UseSharedEventHandler := True;
            End If;
    // Save changes in express report
    (Analyzer As IMetabaseObject).Save;
End Sub UserProc;

After executing the example the express report uses the specified event handler.

See also:

IEaxAnalyzerOptions