This chapter has given us a quick run through all the non-database datasources supported by JasperReports, including how to create our own.
We have created reports that use no external datasources by using an empty datasource and have also used instances of a class implementing java.util.Map
as a datasource by taking advantage of the net.sf.jasperreports.engine.data.JRMapArrayDataSource
class. We learned to use plain Java objects as datasources by employing the net.sf.jasperreports.engine.JRBeanArrayDataSource
and net.sf.jasperreports.engine.JRBeanCollectionDataSource
classes. Besides, we also saw the use of a Swing TableModel
and an XML document as a datasource by implementing the net.sf.jasperreports.engine.data.JRTableModelDataSource
and net.sf.jasperreports.engine.data.JRXmlDataSource
classes respectively.
We have covered not only the datasources supported by JasperReports, but also created custom datasources by creating our own JRDataSource
implementation. In addition to datasources...