patil_ajay1982 Posted June 20, 2009 Share Posted June 20, 2009 one of my paramater contains Arraylist like below.HashMap m= new Map(); ArrayList temp= new ArrayList ();temp.add("one");temp.add("two");m.put("dataSouce " , temp ) how could i populate these value in my report? Link to comment Share on other sites More sharing options...
lucianc Posted June 25, 2009 Share Posted June 25, 2009 You can use a subreport to iterate on the list. Use a JRBeanCollectionDataSource for the subreport (with a single field mapped to _THIS).Regards,Lucian Link to comment Share on other sites More sharing options...
blaguman Posted June 26, 2009 Share Posted June 26, 2009 Yes, you can use a subreport for that.You'll have to create a subreport, and give a subreport expression to the subreport element in your main report like :new JRBeanCollectionDataSource($P{dataSource}) (with dataSource of type Collection, List, Arraylist...)Your subreport will have a REPORT_DATA_SOURCE, and will iterate on the fields you tell him to. Like lucian said, map a field with _THIS (I didn't know that, very interesting ! :)), and use it in the detail band... Regards,Morgan 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