problem with jasperRepport in servoy 4.0.0

I’m trying to build report using jasper has it’s recommended on the forum. It seams that some people succeded in using it, but all I’ve been able to get is “The document has no pages.”

I’ve raise the debug level of servoy to “trace” so that I can follow in servoy log what it’s doing, and everyhting seams to work well. Except that all pdf or view generated are empty.

I’ve been using two different .jrxml that I tested in iReport and they are working fine in iReport. They are not using any database connection just static text. So no error possible from there.

You can fin dthese example here:

http://www2.jasperforge.org/scm/svndownload.php?hash=1cc5ce32d46854ad3187b4746b0906b2&ct=text/plain&filename=StyledTextReport.jrxml

here is the code i’m using to launch jasperRepport

plugins.jasperPluginRMI.reportDirectory = plugins.file.getDesktopFolder();
	
var _file = plugins.http.getMediaData("media:///StyledTextReport.jrxml") ;
var _path = plugins.file.getDesktopFolder() + "/StyledTextReport.jrxml"; 
plugins.file.writeFile(_path, _file);
	plugins.jasperPluginRMI.jasperReport('equipmtl_intranet',_path,null,'view',null);

Thank you for your time!

Philippe Beaulieu

I tried the code you posted and it works ok. Indeed, JR throws an error that the document has no pages but this is what it should do because the document has no data and it tries to build it against a data source.

If you load it in iReport and execute it against a data source will give you the same message. The only time it works is if you run it with an empty data source in iReport. In the sample code, you run it with an active connection so it is normal to show that message.

Try the same example with a different report that has connected data. It will work.