masdar Posted September 11, 2009 Share Posted September 11, 2009 when i export my report ( to a pdf file ) i get null in all my fields ,,i try to run the report in IReport (i pass parameters manulay and use the same xml file ) and it works fine and shows results.the xml file has the following structure:<?xml version="1.0" encoding="ISO-8859-7" ?> <table> <result> <state>ΑΤΤΙΚΗΣ</nomos> <count>9205</count> <percent>73.335 %</percent> </result> <result> <state>ΘΕΣΣΑΛΟΝΙΚΗΣ</nomos> <count>790</count> <percent>6.294 %</percent> </result> <result> <state>ΛΑΡΙΣΗΣ</nomos> <count>343</count> <percent>2.733 %</percent> </result></table>-------------------------------------------------ISO-8859-7" is encoding for greek Code: String XMLfile="reports/xml/report.xml";parameters.put("recordCounter",count ); parameters.put("sum", sum); createXMLfile(count); JasperPrint JasperPrint1; String pdfOutFileName = "pdf/MyPdf.pdf";JRExporter exporter = new JRPdfExporter(); JasperPrint1 = JasperFillManager.fillReport("reports/tempXML.jasper", parameters, new JRXmlDataSource(XMLfile)); exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, pdfOutFileName); exporter.setParameter(JRExporterParameter.JASPER_PRINT, JasperPrint1); exporter.exportReport(); Link to comment Share on other sites More sharing options...
masdar Posted September 12, 2009 Author Share Posted September 12, 2009 I found what the problem wasi had to set the selectExpression in my java code Code:JasperPrint1 = JasperFillManager.fillReport("reports/tempXML.jasper", parameters, new JRXmlDataSource(XMLfile,"/table/result")); Link to comment Share on other sites More sharing options...
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