Question

Can any one please elaborate me what are the benefits of passing bean list of results to 'iReport' instead of simply write complete query in iReport -> Data -> Report Query?

Why it is preferred to use JavaBean as DataSource in iReport? What are the drawbacks and advantages of both these strategies?

Please explain me with example?

Was it helpful?

Solution

Recursive queries.

Some Databases (MySQL) do not have the ability for Recursive Queries, or Hierarchical Data. So sometimes your dataset can only be generated by intelligently compiling data in Java first, and providing a bean instead.

Hibernate

Similar to above, it may be easier to provide a Bean of Hibernate generated objects instead of creating a query from scratch. This also absolves you from generating SQL queries for the different databases your application may support.

Speed / No Database

Sometimes the data you need to generate is not in the database (yet). Or you have no database at all, and you need to generate a report as well. Beans help here too.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top