Respect my work! or BTC: 1MTFbBSKrocPK7G6GKfG8RoTw5N57WnnNa ![]() If you have paid donate send me e-mail with Your data or transaction number to receive an access code to articles with limited access. |
PmWiki /
Attach plugin written in JavaShortcut tableIf a function can not be made with PHP, it is possible to include a reporting system functions written in Java. The following describes the methodology to attach Test object and its use in the report Attach Java object to ProReports.Suppose you have a file test.java with the following content:
public class Test
{
private a int;
private b int;
public Test(Int a, Int b)
{
this.a = a;
this.b = b;
}
public Int Sum()
{
return this.a+this.b;
}
}
After compiling it you get a file test.class. This file should be placed in directory: <directory of proreports>/webapps-plus/rep/WEB-INF/classes If the class uses some libraries, they should be placed in the directory:
<directory of proreports>/JRE/<dir of JVM>/lib/ext
<directory of proreports>/JRE/<dir of JVM>/jre/lib
<directory of proreports>/webapps-plus/rep/WEB-INF/lib Important!
After completing the above steps restart the server ProReports. The use of Java object in Internal report.To use attached object in Internal report, in any Element of the report in part Expression/Code before Template or Expression/Code after Template please enter the code: import Test; $objtst=new Test(2,3); $V[sum]=$objtst->Sum(); This code create object $objtst and set global variable $V[sum], which can be used anywhere in the report. This page may have a more recent version on pmwiki.org: PmWiki:PluginJAVA, and a talk page: PmWiki:PluginJAVA-Talk. |