Summary
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. We 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 also saw how CSV files can be used as datasources for our reports by taking advantage of the net.sf.jasperreports.engine.data.JRCsvDataSource
class.
We have covered not only...