christoph.buehler Posted August 5, 2014 Posted August 5, 2014 I want to compile a .JRXML file with an XML Datasource in Java. It works perfectly within iReport. In Java, it does not work.When I set the main query language to 'xpath', the report is generated, but with no xml data in it.With 'xpath2' as the main query language, I get an error "No query executer factory registered for the 'xpath2' language" and the report is not being generated.It doesn't even work with the simplest report you can think of.What I've tried so far:Checked for the following line in jasperreports.properties:net.sf.jasperreports.query.executer.factory.xpath2=com.jaspersoft.jrx.query.JRXPathQueryExecuterFactoryChecked for the .jar file "jasperreports-extensions-3.5.3.jar" in my applications classpathAdded this line to my Java code:jasperReport.setProperty("net.sf.jasperreports.query.executer.factory.xpath2", "com.jaspersoft.jrx.query.JRXPathQueryExecuterFactory");Set the XML Datasource in Java:org.w3c.dom.Document document = JRXmlUtils.parse(JRLoader.getLocationInputStream(args[2]));params.put(JRXPathQueryExecuterFactory.PARAMETER_XML_DATA_DOCUMENT, document);My report generation code:JasperReport jasperReport = JasperCompileManager.compileReport(args[0]);JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, params, new JREmptyDataSource());JasperExportManager.exportReportToPdfFile(jasperPrint, args[1]);I appreciate your help.
Solution christoph.buehler Posted August 7, 2014 Author Solution Posted August 7, 2014 I solved this issue:http://stackoverflow.com/questions/25153865/xml-datasource-in-report-is-not-working
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now