JS Plugins
The client-side report interception can be done by providing a Java script plugin and defining the same in the report.
To create a javascript plugin, minimally, an init method that takes the JS Report object as a parameter is required. From there you can add listeners for the events that the report fires or can even modify the report object directly. The following is the code example for a report plugin It would be located in jsmodules/ReportPluginExample.js.
define(function(){
Ext.ns(
"ZBKS"
);
ZBKS.ReportPluginExample = Ext.extend(Object, {
init: function(report){
report.renderers = report.renderers || {};
}
});
});
Save this javascript file under public/jsmodules directory.
Select your javascript file and click Submit. This uploads the javascript files to the server.
Finally, reference this plugin from the Report XML:
...
<
Report
columnQuantity
=
"2"
>
<
Name
>ReportExample</
Name
>
<
ReportJsonListenerClass
>com.one.web.ReportExampleListener</
ReportJsonListenerClass
>
<
ReportJsPlugins
>ZBKS.ReportPluginExample</
ReportJsPlugins
> <!-- this line is for referencing the plugin from the report -->
...
Once this is added, submit the report, refresh NEO and invoke the report again to see the plugin in action.
For more information on implementing JS Plugins, please refer to the JS docs.