jasperreport生成pdf_jasperreport 导出excel_jasperreport json(69)

电脑杂谈  发布时间:2017-02-04 10:28:36  来源:网络整理

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

相关阅读
    发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

    热点图片
    拼命载入中...