In order to make use of this functionality, users only have to create a scriptlet class by extending one of
the following two classes:
dori.jasper.engine.JRAbstractScriptlet
dori.jasper.engine.JRDefaultScriptlet
The complete name of this custom scriptlet class (including the package) has to be specified in the
scriptletClass attribute of the <jasperReport> element and has to be available in the classpath,
at report filling time, so that the engine could instantiate it on the fly. If no value is specified for the
scriptletClass attribute, the engine will instantiate the JRDefaultScriptlet class.
When creating a JasperReports scriptlet class, there are several methods that developers should
implement or override, like: beforeReportInit(), afterReportInit(), beforePageInit(),
afterPageInit(), beforeGroupInit(), afterGroupInit(), etc. Those methods will be called
by the report engine at the appropriate time, when filling the report.
For more complex reports, if you need to use very complicate report expressions, for grouping or
displaying data, maybe you should consider transferring this complexity to a separate class to which
you then make calls from simplified report expressions. The scriptlet class is perfect for transferring
this complexity to. This is because the reporting engine supplies you with a reference to the scriptlet
object it creates on the fly using the REPORT_SCRIPTLET built-in parameter.
Check the scriptlet sample to see this type of functionality used.
本文来自电脑杂谈,转载请注明本文网址:
https://www.pc-fly.com/a/ruanjian/article-30468-29.html
不会再拖了
成功的放个屁都是真理
蛆是苍蝇的幼虫
想去存