How to use java beans in ireport tool

0

Hi ,

          I am using ireport tool to generate reports.There is a requirement  to print  javabean values in the report.Is any one know how to use javabeans in ireport tool. Thanks in advance.

Regards,

Kitti

venujasper's picture
Joined: Jan 6 2009 - 10:23pm
Last seen: 1 year 5 days ago

2 Answers:

0

1.For connection as well as for DataSource ....... write an Java bean class and you must have a factory method in that Bean class and this static method should return a Collection of Beans/Array of Beans of type of Current Java Bean[i think you know about Factory class] ... and set this bean .class file path under CLASSPATH in your iReport tool and create a connection and follow below  2nd point to get fields.. 2.For Datasource only ...... set this bean .class file path under CLASSPATH in your iReport tool and -> select ReportQuery under Data option ->click JavaBeanDataSource button give the complete pakaged path for your class and select your needed fields... .....

*I am also new to this and I did like this way only..and let me know whether it is okay or not and is there any alternative?

vattembhaskar's picture
Joined: Jan 20 2009 - 10:58pm
Last seen: 5 years 9 months ago
0

Thank you for reply.

           But How to give CLASSPATH dynamically, because i am using web application i need to give the classpath dynamically.

Is there any way to pass the parameters to the CLASSPATH so that i can pass bean class path dynamically using parameters.

Thanks

 

venujasper's picture
Joined: Jan 6 2009 - 10:23pm
Last seen: 1 year 5 days ago
Feedback