The OnExecuteSqlStatementConstructed Event occurs just before SQL is sent to the Data Source to retrieve data for report execution. This Event could be used to inspect, log or modify the SQL that is being used for report execution.
For custom code the args array is structured as follows:
- a string representing the execution SQL
- a SqlObject class wrapping the execution SQL string in position one.
For .NET Assemblies the method signature is as follows:
WebReports.Api.Datanamespace needs to be included.
string EventHandlerName(SessionInfo sessionInfo, string executionSql, SqlObject sqlObject)
The OnExecuteSqlStatementConstructed Event expects either a SQL string return, to override the default execution SQL, or null, in which case the execution will continue as normal.