I am having some difficulties with the return value of plugins.jasperPluginRMI.runReport(). As it is described in the documentation this should contain a byte array of the file created during runReport (dependent on the arguments for filetype).
So here is a little example
//not working
var pdfBytes = plugins.jasperPluginRMI.runReport(forms.frmTest.controller.getServerName(), 'repTest.jrxml', null, 'pdf', params);
//also not working
var pdfBytes = plugins.jasperPluginRMI.runReport(forms.frmTest.controller.getServerName(), 'repTest.jrxml', '', 'pdf', params);
//but this is working
var pdfBytes = plugins.jasperPluginRMI.runReport(forms.frmTest.controller.getServerName(), 'repTest.jrxml', 'test.pdf', 'pdf', params);
Is there an alternative then using the last statement - as I understand the documentation this should be possible.
Regards
Steffen
P.S.: tested under Servoy Developer and Server unde Linux, Servoy 5.2.6, MySQL, Java 1.6.24, Plugin Version 3.1.0 but using jasperreports-4.0.0.jar (till now no problems)
yes I set the reports directory because ```
plugins.jasperPluginRMI.getReports()
Seems I am hitting the same bug: <a class="postlink-local" href="http://forum.servoy.com/viewtopic.php?f=15&t=15722&p=84588#p84588">viewtopic.php?f=15&t=15722&p=84588#p84588</a>
But one question - how can I get the stack trace as shown in the linked thread? Is there any possibility to get the stack trace of this exception in servoy ? Because I checked out the source code of the plugin and it looks like it shouldn't be to difficult to find the bug...
The exception should be in your servoy_log.txt file (in application_server).
And no it isn’t a very difficult bug to fix, a simple test on filename should be enough to avoid trying to create a non existing file when not necessary.
I will submit a patch for this.
nooutput = true on web client will return a file (of the type you asked for) to the browser, which is unwanted behavior if you only want the byte in code.
This is why I did it this way.