This section introduces a method that has been used in earlier versions. If using this method, you will have to specify the JReport Server installation root as the reporthome unless you make the WAR be a self-contained solution.
This section takes creating a WAR file on Unix for example. The instruction is applicable to both Unix and Windows platforms. However, the paths for Windows should use the Windows format, for example, C:\JReport\Server
, while paths for Unix should use the Unix format, for example, /opt/JReport/Server
.
It is assumed that JReport Server has been installed to /opt/JReport/Server
.
Take the following steps to build a JReport Server WAR manually:
/opt/JReport/Server/
jreport
. /opt/JReport/Server/jreport/WEB-INF
.
|
jreport/WEB-INF
directory:
mkdir lib
jreport/WEB-INF/lib
directory:
mkdir lib/pages
/opt/JReport/Server/lib/pages
to the jreport/WEB-INF/lib/pages
directory:
cp /opt/JReport/Server/lib/pages/* lib/pages
/opt/JReport/Server
and name it languages.jar. For example, run the following command:
jar -cvf languages.jar resources
Then put the languages.jar in /opt/JReport/Server/lib
.
/opt/JReport/Server/lib
to the jreport/WEB-INF/lib
directory: commons-codec-1.2.jar, jai_codec.jar, jai_core.jar, JREngine.jar, JRESServlets.jar, JRWebDesign.jar, languages.jar, log4j-1.2.8.jar, sac.jar, tar.jar, xercesImpl.jar, xml-apis.jar.
If you want to export reports to the following formats, you should copy the corresponding jar to the jreport/WEB-INF/lib
directory:
/opt/JReport/Server/public_html
to the /opt/JReport/Server/jreport
directory:
cp -r /opt/JReport/Server/public_html/* /opt/JReport/Server/jreport
Notes:
/opt/JReport/Server/jreport
, for example, /opt/JReport/Server/jreport/sub
, to view reports in Page Report Studio, you need:
web.skin.dir=/jreport/sub/skin
dhtmlConfig.setDHTMLContextPath(SessionID,"http://localhost:8080/jreport/sub");
dhtmlConfig.setDHTMLJspUrl(SessionID,"/jreport/sub/dhtmljsp/");
dhtmlConfig.setDHTMLServletUrl(SessionID, RptSetId, "/jreport/dhtml");
<FRAME name="ind" src="/jreport/sub/jinfonet/index.jsp" frameborder="0">
Then go to step 11.
/jreport
to the src tag. Note that the path separator character is the Unix style "/" when referencing JSP. The result should be as follows:
<FRAME name="ind" src="/jreport/jinfonet/index.jsp" frameborder="0">
jreport/WEB-INF
directory. If yes, make sure the following line is added in the weblogic.xml:
<show-archived-real-path-enabled>true</show-archived-real-path-enabled>
If no, create a weblogic.xml and add it in the jreport/WEB-INF
directory. The content in the weblogic.xml looks like:
|
jar -cvf jreport.war index.htm admin dhtmljsp images javascript jinfonet skin style WEB-INF
Note: The jar utility is in the Java home bin directory. If it is not on your path you must call jar with the entire path, for example, /opt/jdk1.6.0_17/bin/jar.exe
.
To make the WAR include a self-contained JReport Server, except for the above procedure, you need create jrenv.jar and then put it in the jreport/WEB-INF/lib
directory before creating the WAR.
Use either way to create the jrenv.jar:
makewar jrenv.jar
See also Building a WAR/EAR file to include a self-contained JReport Server for details about the structure of the jrenv.jar.