Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

passing collection as datasource to jasper report.

 
Rajubhai Kotwal
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Experts, I am trying to work on report which contains main report and sub reports. In main report's header i want to pass sub report to print the header and in sub report i want to display data. I am using JRBeanCollectionDataSource. I have created a bean class where in I am setting/getting methods. In my main class I am exporting the beans to jasper file. My problem resides in passing collections of multiple beans. How should I pass multiple beans to jasper files?


Now my problem is how to pass Object of here? Instead of passing list through JRBeanCollectionDataSource jbs = new JRBeanCollectionDataSource(list); i would like to pass Object of list so that i can send multiple beans. I can pass collection through public JRBeanCollectionDataSource(java.util.Collection beanCollection) but not the objects. Does anyone know how should i pass objects? I am stuck in this problem as i am confused here while passing datasource. I can pass only one datasource to jasper report. Please do let me know your ideas and suggestions. Thank you.
 
Julius Kabugu
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to Javaranch Julius Kabugu!
 
Julius Kabugu
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you! Hope to contribute largely!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic