I'm new to Rails but not to Java. I've been trying to test out the jasper-rails
project at https://github.com/fortesinformatica/jasper-rails and that documentation makes it seem simple, but I have found it less so. And the developer hasn't responded to my issue, so I'm asking here.
I created my report with iReport (which jasper-rails
implies works) and I put the .jrxml file in app/views/jasper/index.jrxml
. When I load up localhost:3000/jasper.pdf
I get this error:
RuntimeError (net.sf.jasperreports.engine.JRException: org.xml.sax.SAXParseException;
lineNumber: 8; columnNumber: 16; Error at line 8 char 16: No query executer factory
registered for the 'xpath2' language.): app/controllers/jasper_controller.rb:7:in `index'
So it seems to not know what to do with xpath2
. Unfortunately, the only option I have in the version of iReport is xpath2
. If I scroll up in the Rails output I see:
java.lang.reflect.InvocationTargetException
[....]
Caused by: net.sf.jasperreports.engine.JRRuntimeException: No query executer factory registered for the 'xpath2' language.
at net.sf.jasperreports.engine.util.JRQueryExecuterUtils.getExecuterFactory(JRQueryExecuterUtils.java:114)
at net.sf.jasperreports.engine.design.JRDesignDataset.queryLanguageChanged(JRDesignDataset.java:1152)
at net.sf.jasperreports.engine.design.JRDesignDataset.setQuery(JRDesignDataset.java:630)
at net.sf.jasperreports.engine.design.JasperDesign.setQuery(JasperDesign.java:791)
So it seems that JasperReports needs something configured for xpath2.
I've replaced the jars that jasper-rails
uses with the jars in ireport/modules/ext
but I got the same response. So, somehow, I have to tell jasper-rails
about my xpath2
. But how? Or would an older version of iReport work better? Has anyone got this to work?