writeReport() methods exposed by the dori.jasper.engine.xml.JRXmlWriter utility class.
10.2 Implementing Data Sources
JasperReports library comes with several default implementations of the
dori.jasper.engine.JRDataSource intece. This intece is used to supply the report data
when invoking the report filling process, as explained in the previous chapters of this book.
These default implementations let you generate reports using data from relational databases retrieved
through JDBC, from Java Swing tables or from collections and arrays of JavaBeans objects.
But maybe your application data that your are trying to display in your reports has a special structure or
is organized in a very particular way preventing you from using any of the default implementations of
the data source intece that come with the library.
In such situations, you will have to create custom implementations for the
dori.jasper.engine.JRDataSource intece, in order to wrap your special report data, so that
the reporting engine can understand and use it when generating the reports for you.
The JasperReports Ultimate Guide
Page 68
Creating a custom implementation for the dori.jasper.engine.JRDataSource intece is not
very difficult since you have to implement only two methods.
The first one, the next() method, is called by the reporting engine every time it wants the current
pointer to advance to the next virtual record in the data source.
The other, the getFieldValue() method, is called by the reporting engine with every iteration in the
本文来自电脑杂谈,转载请注明本文网址:
https://www.pc-fly.com/a/ruanjian/article-30468-69.html
在所不辞