Express > Express Assembly Interfaces > IEaxAnalyzerOptions > IEaxAnalyzerOptions.UseSharedEventHandler
UseSharedEventHandler: Boolean;
The UseSharedEventHandler property determines whether express report uses event handler.
Available values:
True. Default value. Express report uses event handler.
False. Express report does not use event handler.
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 that is 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 variables area
ShPar := MB.SpecialObject(MetabaseSpecialObject.SharedParams);
// Get repository parameters
SParams := Shpar.Edit As ISharedParams;
// Get object for working with report event handler
EventHandlers := SParams.EventHandlers;
// Use report event handler
EventHandlers.Enabled := True;
// Get and activate express report event handler
EventHandler := EventHandlers.EventHandler(SharedEventHandlerType.ExpressReport);
EventHandler.Enabled := True;
// Connect event handler
EventHandler.Object := MB.ItemById("EXPRESSREPEVENTS");
// Set unit 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 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: