JasperReports plugin doesn't open a report

Hello,

I want to display a report using JasperReports plugin in my Servoy application. I have the report created in IReport-3.7.3.

I also setup the directory where the reports are stored and the plugins.jasperPluginRMI.getReports() returns to correct list of report files present in the directory.

However, when I call the plugins.jasperPluginRMI.runReport(controller.getServerName(), “demo.jasper”, null, “view”, null); method I receive an exception.

This is how it looks in the Servoy console:

Wrapped java.lang.Exception (D:\workspace\Project\forms\main.js#30)
at D:\workspace\Project\forms\main.js:30 (onAction)

And this is how it looks in the servoy_log.txt file:

2010-06-25 16:23:52,460 ERROR [AWT-EventQueue-0] com.servoy.j2db.util.Debug - Throwable
org.mozilla.javascript.WrappedException: Wrapped java.lang.Exception (D:\workspace\Project\forms\main.js#30)
at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1828)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:199)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:353)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3666)
at script.onAction(D:\workspace\Project\forms\main.js:30)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2680)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:166)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:387)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3127)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:165)
at com.servoy.j2db.scripting.Ztb.executeFunction(Ztb.java:196)
at com.servoy.j2db.scripting.Zub.executeFunction(Zub.java:97)
at com.servoy.j2db.Zwb.Za(Zwb.java:741)
at com.servoy.j2db.Zwb.Za(Zwb.java:1223)
at com.servoy.j2db.Zcc.Za(Zcc.java:1)
at com.servoy.j2db.ui.BaseEventExecutor.fireEventCommand(BaseEventExecutor.java:27)
at com.servoy.j2db.ui.BaseEventExecutor.fireEventCommand(BaseEventExecutor.java:18)
at com.servoy.j2db.ui.BaseEventExecutor.fireActionCommand(BaseEventExecutor.java:16)
at com.servoy.j2db.dataui.Zab.actionPerformed(Zab.java:3)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.Exception
at com.servoy.plugins.jasperreports.JasperReportsProvider.runReport(JasperReportsProvider.java:520)
at com.servoy.plugins.jasperreports.JasperReportsProvider.js_runReport(JasperReportsProvider.java:305)
at com.servoy.plugins.jasperreports.JasperReportsProvider.js_runReport(JasperReportsProvider.java:302)
at com.servoy.plugins.jasperreports.JasperReportsProvider.js_runReport(JasperReportsProvider.java:298)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:179)
… 41 more

Please someone help me with this.

Maybe the plugin version doesn’t match the iReport version the report was created with? Check the jasperreports .jar in the plugins folder, it’s probably older. You may be able to copy the 3.7.3 version from iReport.

Yes, now it works, thank a lot :)

I just replace the jasperreports-3.7.1.jar with jasperreports-3.7.3.jar and commons-beanutils-1.8.0.jar with commons-beanutils-1.8.2.jar, as these were the only differences, and also change the name of the files in the servoy_jasperreports.jar.jnlp

I am having a similar problem with v3.0 plugin and v3.6 iReports (Servoy 5.1.4). My code is not displaying the report/viewer.

plugins.jasperPluginRMI.runReport(forms.contact_layout_main.foundset,'report1_36.jrxml',null,'view',null);

The server log does not have and errors listed. Note: This was my first attempt to generate a report from servoy to iReports. Bummer, didn’t work.

James,

Are you running the report in Servoy developer, in Web Client or in Smart Client?

In case of Smart Client I would expect an error in the java console.

Rob

I am running from developer,/smart client. No errors popping up anywhere. I have also confirmed the reports folder is listed on the server admin.

James,

have you checked /path/to/servoy/application_server/servoy_log.txt and /path/to/workspace/.metadata/.log

Rob

Rob,

No errors in the servoy_log.txt and I do not have a /.metadata/.log folder in my workspace

Hi James,

These directories/files that start with a period are invisible files/directories so that’s the reason you don’t see them.
But you don’t have to open up the terminal to see them. Eclipse comes with the Error Log view. You can add it to the perspective you are working in.
Just go to Menubar > Window > Show View > Other…
Then you get a dialog where you can select the Error Log view.
After pressing the OK button the view will hover in your perspective, just drag it to the position you want.

Hope this helps.

Great, lots of things tucked away in there…

The error log was rather under whelming.refer attached. I cleared the log, re-ran servoy developer and the client, attempted to run the method and attached is the result.

error.txt (1.67 KB)

thats the default startup log, doesnt show anything that it shouldnt show.

Johan, what should I do next?

James,

Try turning tracing on in servoy.properties, maybe there will be a clue.

First stop Servoy (it will write to servoy.properties), then change

log4j.logger.com.servoy.j2db.util.Debug=WARN

to

log4j.logger.com.servoy.j2db.util.Debug=TRACE

messages are written to servoy_log.txt

Rob

Nothing seems to stick out in this (for me anyway). I am curious about the Old/Deleted? lines…but first things first…Jasper…

One of the last actions was to run the method, I am happy to see it found the correct folder.

servoy_log - Copy.txt (529 KB)

James,

Does your report have pages? An empty report may not show up.
But then I still would expect a “JasperTrace: JasperReport finished” message in the logfile.

You can file a case in our support system, attach a sample and the report so we can investigate more.

http://crm.servoy.com/servoy-webclient/ … oy_support

Rob