dhairyashil.bhosale584 Posted January 4, 2016 Share Posted January 4, 2016 Hi all, I am new to jasper, i am learing that how to use jsper to generate PDF and excel report and jasper help me to generate these kind of report. Now I am trying to iterate the values of HashMap into jrxml and in hashMap the values are passed as list, so I pass hashMp to fillReport, but on jrxml side how to iterate hashmap? please help me to iterate hashMap on jrxml side?List<String> severity = // some values;List<String> messages = // some values;LinkedHashMap parameters = new LinkedHashMap(); parameters.put("severity", severity); parameters.put("messages", messages);jPrint = JasperFillManager.fillReport(jasperreport,parameters,new JREmptyDataSource()); JasperExportManager.exportReportToPdfStream(jPrint,baos); [/code] Link to comment Share on other sites More sharing options...
hozawa Posted January 4, 2016 Share Posted January 4, 2016 Haven't done this myself but did you create a parameter with HashMap datatype and created scriplets to process the parameter? Link to comment Share on other sites More sharing options...
Solution dhairyashil.bhosale584 Posted January 4, 2016 Author Solution Share Posted January 4, 2016 I added parameter in jrxml but how to iterate those parameter in jrxml? <parameter name="severity" class="java.util.ArrayList"></parameter><parameter name="messages" class="java.util.ArrayList"></parameter>//In textField added:<textFieldExpression><![CDATA[$F{severity}]]></textFieldExpression><textFieldExpression><![CDATA[$F{messages}]]></textFieldExpression>[/code]like above I am trying to iterate the severity and message parameter in jrxml ? 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