Hi Marcel,
var $parameters = new java.util.HashMap();
$parameters.put(‘engineers_report_id’,27)
$parameters.put(‘SUBREPORT_DIR’,‘\\192.168.1.15\JasperReports\’)
//Trying to compile subreports before running the main report
plugins.jasperPluginRMI.jasperCompile(‘\\192.168.1.15\JasperReports\engineers_report_subreport4.jrxml’,true)
plugins.jasperPluginRMI.jasperCompile(‘\\192.168.1.15\JasperReports\engineers_report_subreport3.jrxml’,true)
plugins.jasperPluginRMI.jasperCompile(‘\\192.168.1.15\JasperReports\engineers_report_subreport2.jrxml’,true)
plugins.jasperPluginRMI.jasperCompile(‘\\192.168.1.15\JasperReports\engineers_report_subreport1.jrxml’,true)
plugins.jasperPluginRMI.jasperCompile(‘\\192.168.1.15\JasperReports\untitled_report_2.jrxml’,true)
//Running the main report
plugins.jasperPluginRMI.jasperReport(‘spaceair’,‘engineers_report.jrxml’,null,‘view’,$parameters)
The above method is the attempts I’ve made to catch an error. First I have compiled the sub reports seperately before running the main report.
The script ran withou errors till it came to the line where the main report was run. The error was
java.lang.Exception: Class not found when loading object from file : C:\Program Files\Servoy\JasperReports\engineers_report.jasper
org.mozilla.javascript.JavaScriptException: java.lang.Exception: Class not found when loading object from file : C:\Program Files\Servoy\JasperReports\engineers_report.jasper
When that didn’t work I ran the sub-reports individually to catch an error or to make sure they were compiled incase my first attempt to compile them didnt work.
var $parameters = new java.util.HashMap();
$parameters.put(‘engineers_report_id’,27)
$parameters.put(‘SUBREPORT_DIR’,‘\\192.168.1.15\JasperReports\’)
//Running all reports starting from the last sub report.
plugins.jasperPluginRMI.jasperReport(‘spaceair’,‘engineers_report_subreport4.jrxml’,null,‘view’,$parameters)
plugins.jasperPluginRMI.jasperReport(‘spaceair’,‘engineers_report_subreport3.jrxml’,null,‘view’,$parameters)
plugins.jasperPluginRMI.jasperReport(‘spaceair’,‘engineers_report_subreport2.jrxml’,null,‘view’,$parameters)
plugins.jasperPluginRMI.jasperReport(‘spaceair’,‘engineers_report_subreport1.jrxml’,null,‘view’,$parameters)
plugins.jasperPluginRMI.jasperReport(‘spaceair’,‘untitled_report_2.jrxml’,null,‘view’,$parameters)
//Running the main report
plugins.jasperPluginRMI.jasperReport(‘spaceair’,‘engineers_report.jrxml’,null,‘view’,$parameters)
This returns the same error
java.lang.Exception: Class not found when loading object from file : C:\Program Files\Servoy\JasperReports\engineers_report.jasper
org.mozilla.javascript.JavaScriptException: java.lang.Exception: Class not found when loading object from file : C:\Program Files\Servoy\JasperReports\engineers_report.jasper
Thanks,