This Wiki Page is a work in progress
- JasperReports Server 5.6 or later (the custom visualization component requires JasperReports 5.6 to run)
- PhantomJS, a command line tool available for all the main operative systems (http://phantomjs.org/download.html)
After downloading and installing phantomjs, be sure it works. Put it in the path, so it can be easily executed by the JVM.
The executable can be also specified by using the jasperreports property:
Installing the custom component Jar (if required)
Add the jasperreports-customvisualization.jar into the WEB-INF/lib directory of your JasperReports Server web application (it should or will added to 6.x versions of the server)
- Configuring the JasperReports properties.
The Custom Visualization Component requires a very simple configuration which consists in specifying where the require.js script is located (used for server side export only, like PDF) and allowing JasperReports Server to serve files from a specific package (like for other components like the JasperReports HighCharts custom component). This information is provided by setting two JasperReports properties inside the file jasperreports.properties. On the server this file is located at:
<JRS installation directory>/apache-tomcat/webapps/jasperserver-pro/WEB-INF/classes/jasperreports.properties
The two properties are:
Replace /path/to/require.js with a proper absolute path to require.js. Please note that on Windows this path might just start with a letter (i.e. C:/path/to/require.js), while on the other systems, this should be prefixed by file://. This comes from a PhantomJS requirement when loading files from the local filesystem. However in testing Windows 7 the correct syntax was like com.jaspersoft.jasperreports.components.customvisualization.require.js=file:///C://appservers//apache-tomcat-7.0.22//tomcat-7.0.22_6.2.0//webapps//jasperserver-pro//optimized-scripts//bower_components//requirejs//require.js
When working with Jaspersoft Studio, these two properties are automatically generated and added to the JasperReports properties handled by the designer, you can see them from the Preferences > Jaspersoft Studio > Properties.
The final requirement is of course the component itself. This is represented by a jar, that must be added to your classpath. The jar should be shipped with JasperReports Server, it is also shipped with Jaspersoft Studio.
- Finally Restart the server.
The Customer needs to run JS optimization after such setup, in other hand it can be broken in optimized mode
- Custom Visualization Component v6.0.x (Calls this page)