Ok! Found the answer. The steps are as below.
- Compile the bean classes and create a JAR file. This needs to have the complete package
- Add this jar to the LIB folder in ireports
- Create a factory/wrapper class that has a createBeanCollection method that populates a collection
- Use this class's top level package as the class path in ireports
- Use this class as the JavaBean datasource with the method.
Once all this is done, create a report with the new datasource and in report query, give the FQN on the Java bean and add the desired field.