The JavaScript files are optimized to improve performance in jasper server. If you customize any JavaScript files, you need to download the optimization tools, optimize the files and restart JasperReports Server.
Inside the JasperReports Server web application, the JavaScript files are in the /scripts and /fusion folders.
Make data easy with Helical Insight.
Helical Insight is the world’s best open source business intelligence tool.
File names contain module and subcomponent names, for example /scripts/adhoc.start.js.
To optimize and implement custom JavaScript files:
For convenience, these steps assume that you place the JavaScript files from JasperReports Server and the scripts necessary to optimize them in a single Working directory.
You can place the files and scripts wherever you want but modify the paths accordingly.
- Create a working directory where you can copy JavaScript files and install and run the required scripts. In this example, the directory is called Working.
- Download and install node.js from http://nodejs.org/. Place the nodejs folder directly in your Working folder.
- Download r.js, a requirejs optimization file, from http://requirejs.org and place it directly in the Working folder
- Create a subdirectory inside nodejs folder for a copy of the JavaScript files from JasperReports Server. This directory is called js-sources.
- Copy the following directories from the JasperReports Server directory, , to js-sources:
- Copy /scripts to js-sources/scripts.
- Copy /fusion to js-sources/fusion
- Back up your js-sources directory.
- Create an optimized-scripts directory for the output of the optimization process.
- Back up your jasper server optimized-scripts directory.
- Open a command line tool and run the commands to optimize the JavaScript.
- If you are using visualize.js, run the commands to optimize it.
- Open file Working/js-sources/scripts/build-visualize.js with text editor.
- Save the file and close editor.
- Run the following command in the working folder:
- Copy the optimized scripts from your Working directory /optimized-scripts to Jasper Server /optimized-scripts
- Restart the Server
In the following example is for Windows, it places the output in the optimized-scripts folder:
% cd Working % nodejs\node r.js -o js-sources\scripts\build.js appDir=js-sources\scripts baseUrl=. optimize=uglify2 dir=optimized-scripts
Remove src/ from the following file paths:
"mainConfigFile": "src/require.config.js", ... "startFile": "src/client/visualize.js.start.frag", "endFile": "src/client/visualize.js.end.frag"
% nodejs\node r.js -o js-sources\scripts\build-visualize.jsout=optimized-scripts\client\visualize.js
If you don’t find src/ in file Working/js-sources/scripts/build-visualize.js, then directly do the step C
Make data easy with Helical Insight.
Helical Insight is the world’s best open source business intelligence tool.
Now you can see the latest changes applied in scripts in jasper server
Best Open Source Business Intelligence Software Helical Insight is Here
A Business Intelligence Framework
If you have any queries please get us at support@helicaltech.com
Thank You
Ramu Vudugula
Helical IT Solutions Pvt Ltd