We can instruct the reporting engine to cache this particular subreport design object. This way we are
making sure that the subreport design will be loaded from disk or from its particular location only once
and then it will only be reused every time it has to be filled.
By setting the isUsingCache attribute to "true", the reporting engine will try to recognize
previously loaded subreport design objects, using their specified source. For example, it will recognize
a subreport object if its source is a file name that it has already loaded, or if it is the same URL.
This caching functionality is available only for subreport elements that have expressions returning
java.lang.String objects as the subreport design source, representing file names, URLs or
classpath resources. That's because the engine uses the subreport source string as the key to recognize
that it is the same subreport design that it has already cached.
The JasperReports Ultimate Guide
Page 65
9.1 Subreport Parameters
Since subreports are normal reports themselves, they are compiled or filled in the same way. This
means that they also require a data source from which to get the data when they are filled and that can
also receive parameters, for the additional information they have to use when being filled.
There are two ways to supply the parameter values to a subreport and they can be used simultaneously,
if desired.
You can supply a map containing the parameter values, like we do when filling a normal report with
本文来自电脑杂谈,转载请注明本文网址:
https://www.pc-fly.com/a/ruanjian/article-30468-64.html
这也是后来的战列舰大战通常采取的战法
依旧帅#宋茜4walls#
我以FFF团的名义召唤你们