The functionality provided by Jasper report is strong enough, but still not fully connected to the customer's needs, so we need to customize the components to complete the design of our report, environment configuration before development is still a hassle ...
System: Linux
Ide:jasper Studio (version:6.3)
Server:jasper Server (version:6.3)
Jasper Report Although support for custom components, but in the version we used, did not integrate some of the required configuration into the installation environment, still need to manually intervene to set up the environment,
The following is the basic process for developing a custom component:
Phantomjs
First you need to download the PHANTOMJS, get the. zip file, unzip it, there are two ways to make it work:
(1) Configure it to the system environment variable, the command terminal input phantomjs-v or PHANTOMJS--version display PHANTOMJS version that indicates the configuration is successful.
(2) Use com.jaspersoft.jasperreports.components.customvisualization.phantomjs.executable.path=/path/bin/ Phantomjs can be.
Jasper Studio
In the pop-up window, click Preference, Jaspersoft Studio, Properties, ADD, and then configure the following on the property Name-value:
(1) Com.jaspersoft.jasperreports.components.customvisualization.phantomjs.executable.path=/path/bin/phantomjs
(2) Com.jaspersoft.jasperreports.components.customvisualization.require.js=file:/path/to/require.js
(3) net.sf.jasperreports.web.resource.pattern.customvisualization=com/jaspersoft/jasperreports/ customvisualization/.*
Note: The environment is configured with PHANTOMJS (1) is not required, configuration (2) should be noted that Linux and Windows are not the same, the Linux prefix is file:/,windows with the absolute path on the line,
And, Jasper Studio already contains the Requirejs, the path is under the installation path under the configuration/org.eclipse.osgi/25/0/.cp/resources/scripts a file is, You can configure it yourself.
Jasper Server
IDE equipped with the need to configure the server, or it is a big trouble, in the local and can run, but not on the server to run up is not too bad, the following is the configuration steps:
1. Find Jasperreports-customvisualization.jar This package in Jasper Studio and add it under Web-inf/lib under Jasperserver under Tomcat WebApps, Some versions of this package already exist,
But it is recommended to replace it.
2. Under web-inf/classes find jasperreports.properties This file, in the file need to add something:
(1) Com.jaspersoft.jasperreports.components.customvisualization.phantomjs.executable.path=/path/bin/phantomjs
(2) com.jaspersoft.jasperreports.components.customvisualization.require.js=file:///path/apache-tomcat/webapps/ Jasperserver/optimized-scripts/bower_components/requirejs/require.js
(3) net.sf.jasperreports.web.resource.pattern.customvisualization.scripts=com/jaspersoft/jasperreports/ customvisualization/resources/require/.*
Note: Similarly, the system environment with PHANTOMJS is not required (1), here the Requirejs and Jasper Studio in a little bit different, compared to the bottom of the version is not the same.
The above is the need to use the custom visualization environment configuration.
Jasper Report's Custom visualization environment configuration