The OnOkFiltersDialog Event occurs when a user clicks on the Ok button in the Filter Execution Window. This window only displays if prompt for value was checked for a filter. This Event could be used to see what filters are being used on the report and/or assure that a filter exists.
Signature
For custom code the args array is structured as follows:
args[] is empty.
For .Net Assemblies the method signature is as follows:
string EventHandlerName(SessionInfo sessionInfo)
Expected Return
The OnOkFiltersDialog Event expects a string to be returned. Based on the returned string there are three possible results.
Notes
The filters of the report being executed can be accessed through the sessionInfo object by using sessionInfo.ReportExecFilters.
Example
The following example provides C# code that will prevent the Filter Execution Window from closing if there are no filters specified. This and similar checks can help prevent users from executing Reports that result in unnecessarily-large queries going against the Data Source(s).”
string hasFilters = null; if(sessionInfo.Report.Filters.Count() > 0) { hasFilters = “Please add Filters to the Report.”; } return hasFilters;