Scroll

Action Event: Double-click to run a report

Normally when a user double-clicks on a report, it opens for editing. You may wish to change the default handling so that double-clicking runs the report instead. This is possible using the OnDoubleClickReport global action event.

Note: In this example, the client-side javascript is in separate file to improve readability.

Global Event Type: OnDoubleClickReport

Code

string actionString = File.ReadAllText(@"{filepath}\actionString.js");
sessionInfo.JavascriptAction.SetJsCode(actionString);
return sessionInfo.JavascriptAction;

actionString.js

(function()
{
  var node = clientInfo.utilities.TreeCtrl.GetSelectedNode(clientInfo.webReportsCtrl.reportsTreeId);
  if (node == null)
    return; // on an invalid node, abort the function
  clientInfo.ExecuteReport(node.reportName);
  return true;
}())

Hidden Article Information

Article Author
Exago Development
created 2016-12-13 15:22:30 UTC
updated 2017-06-19 20:01:29 UTC

Labels
SAE, action event, events, example, double-click, double, execute,
Have more questions? Submit a request