JReport Server requires a reporthome as its working space to hold the entire JReport runtime environment, including the server properties, configuration files and resources. The package jrenv.jar that contains the entire JReport runtime environment will be extracted to the specified reporthome when initializing JReport Server. The reporthome can be any location on the disk where JReport Server has read and write privileges.
You do not have to specify a reporthome for JReport Server since it will create a default reporthome location <user.home>/.jreport/default
.
However, JReport Server enables you to customize the reporthome location before creating the JReport Server WAR/EAR using the provided tool. You can either specify reporthome directly or specify the implementation of the jet.server.api.http.CustomizedServerEnv interface.
Note: Make sure that the reporthome for the integrated JReport Server is different from that of the standalone JReport Server.
The jet.server.api.http.CustomizedServerEnv interface can be used for specifying the JReport Server reporthome and for setting the server properties in a Java EE environment. It contains two methods:
If you specify the implementation of this interface, JReport Server will obtain not only reporthome but also server properties.
There are three ways of specifying reporthome directly or the implementation of the jet.server.api.http.CustomizedServerEnv interface:
Set the JVM option -Dreporthome
before starting the application server, for example:
-Dreporthome=/home/jreport
For example:
Properties props = new Properties();
props.setProperty("reporthome", "/home/test/JReport");
HttpUti.initEnv(props);
The following introduces several methods of specifying reporthome or implementation of CustomizedServerEnv: