jasperreport生成pdf_jasperreport 导出excel_jasperreport json(29)

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

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

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

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