This page explains how to configure and run the samples in TIBCO Jaspersoft® Studio.
Download PhantomJS from http://phantomjs.org/ and copy the phantomjs binary in the PATH, so TIBCO JasperReports® Library will be able to find it easily.
If you don't want the binary to be in the path, you can specify its exact location of the executable by setting the property:
There may be some issues with latest version of PhantomJS and particularly v. 2.2.1. The sample provided here have been tested with Phantom v. 1.9.7
Configuring the required jasperreports properties
Jaspersoft Studio comes preconfigured to properly run reports using custom visualization components (except for PhantomJS which cannot be shipped along with JSS due to licensing issues).
Jaspersoft Studio pre-configures for us a couple of properties, so actually there is nothing to do on a normal installation.
Just for reference, here is what it's preconfigured. First of all, Jaspersoft Studio (or better JasperReports Library) needs to know where the require.js script is located, by means of this property:
Require.js is shipped with Jaspersoft Studio and the value of the property is set to the proper path automatically.
On Windows, a bug of PhantomJS requires you to remove the file://. (The PhantomJS bug is https://github.com/ariya/phantomjs/issues/10231)
Anyway, the platform check is performed by Jaspersoft Studio when the Custom Visualization Component plugin is activated, and the property is set accordingly to it.
The other property set by Jaspersoft Studio, used only when running reports in interactive environments (Interactive Viewer in Jaspersoft Studio and TIBCO JasperReports® Server), is the package from which JasperReports is allowed to load resources. The property and its value are:
Installing the samples
- Download the samples from this page: CVC_samples_20150127.tgz
- From Jaspersoft Studio select File > Import then select General > Existing Projects into Workspace
- Select the radio "Select archive file" and select the CVC_samples_xyz.tgz archive and press finish.
- The new CVC project with a set of samples will be imported inside your Workspace
Each folder inside the CVC project is a sample. Each sample includes several files:
- A "compiled" version of the component (i.e. plain.min.js)
- A sample report to showcase the use of the component (i.e. pain.jrxml)
- Optionally a css file used by the component
Running the samples
We are ready to go!
Open a sample. All the samples use an empty data source or the Sample DB, which are both preconfigured in any Jaspersoft Studio environment.
Press Preview for the "Java" preview:
To test the same report in HTML click on HTML output format:
And you will be able to play with the zoomable circle packing used in this example:
The next step is to try this report inside the interactive viewer. Select the interactive viewer mode:
And run the report inside the interactive viewer:
Deploy and test the samples on JasperReports Server
I'm sure that at this point you would like to test the reports on the server.
There is a step by step guide on how to configure the server on this page: JasperReports Server setup for Custom Visualization Component
Open a report (i.e. Zoomable Circle Packing)
Deploy it on the server by using the deploy button (the small server icon with the blue arrow)
Select where to deploy it on the server:
Use as data source /datasources/JServerJNDIDS which usually points to a database with the orders table, compatible with the one used to create the samples.
This should be the result after the publishing the new report unit:
Click finish and look on the server the new report, run it and you should be able to see the report running inside JasperReports Server:
- Custom Visualization Component v6.0.x (calls this page)