Scroll

Global Event: OnOkParametersDialog

The OnOkParametersDialog Event occurs when a user clicks on the Ok button of the Parameter Prompt Window. The window will only displays if the report has a non-hidden parameter with a prompt text. This Event could be used to see what values the user is setting for each prompting parameter.

Signature

For custom code the args array is structured as follows:

args[] is empty.

For .Net Assmblies the method signature is as follows:

string EventHandlerName(SessionInfo sessionInfo)

Expected Return

The OnOkParametersDialog Event expects a string to be returned. Based on the returned string there are three possible results.

  • Null / Whitespace – If the string is null or whitespace then the report execution will continue as expected.
  • LanguageId – If the string matches the id of any element in the language files then the string of that language element will be displayed as a message to the user. For more information see Multi-Language Support.
  • Other – If the string does not match the id of any element in the language files then the returned value will be displayed as a message to the user.

Notes

This Event cannot override the value of Parameters for the report execution.

The Parameters of the report being executed can be accessed through the sessionInfo object by using sessionInfo.Report.

Example

The following example provides C# code that will prevent the Parameters Execution Window from closing if a specified parameter is blank. The user will be prompted with a message from the language file.

//assumes the language file has an element with the id “PleaseEnterParam”
return (String.IsNullOrWhiteSpace(sessionInfo.GetReportParameter("promptName").Value) ? "PleaseEnterParam" : null);
 

Hidden Article Information

Article Author
Exago Development
created 2017-02-21 15:59:55 UTC
updated 2017-06-27 14:41:27 UTC

Labels
Server Events, parameters, event handlers, list of server events, parameter, okparametersdialog, parametersdialog, promptdialog, dialog, param, ok,
Have more questions? Submit a request