Jump to content

How to iterate HashMap(Arraylist) into jrxml?


Go to solution Solved by dhairyashil.bhosale584,

Recommended Posts

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

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

  • Solution

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

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...