Subreports behave in the same way and expect to receive the same kind of input when they are being
filled.
You can supply to your subreport either a data source using the <dataSourceExpression> element
or a JDBC connection for the engine to execute the subreport's internal SQL query using the
<connectionExpression> element. These two XML elements cannot be both present at the same
time in a subreport element declaration. This is because you cannot supply both a data source and a
connection for your subreport. You have to decide on one of them and stick to it.
The report engine expects that the data source expression returns a
dori.jasper.engine.JRDataSource object and that the connection expression returns a
java.sql.Connnection object, whichever is present.
You can see how subreports work, if you check the subreport sample.
The JasperReports Ultimate Guide
Page 67
10 Advanced JasperReports
Previous chapters have presented the core functionality that most people will get to use when working
with the JasperReports library.
However, some complex requirements of your specific applications might force you to dig deeper into
the JasperReports functionality in order to adapt it to suit you needs.
In the following sections we are going to take a closer look at those aspects that are likely to interest
you if you'll want to make full benefit from the use of the JasperReports library.
10.1 XML Report Designs Loading and Writing
In the 3.2 Compiling Report Designs chapter we have explained how report designs pass from their
本文来自电脑杂谈,转载请注明本文网址:
https://www.pc-fly.com/a/ruanjian/article-30468-67.html
文章分明不全
受不了啦
其实也就等同于今后任何国家到美国去巡航