Jump to content

using JRXmlDataSource?


masdar

Recommended Posts

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

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...