Scriptlet
来源:互联网 发布:maya软件大小 编辑:程序博客网 时间:2024/05/23 15:34
A Script is a Java Class that extends one of the two following classes:
- JRDefaultScriptlet
- JRAbstractScriptlet
The sample extends the JRDefaultScriptlet. The difference between the two is with JRAbstractScriptlet a developer must implement all the abstract methods.
By extending JRDefaultScriptlet a developer is only required to implement that methods he/she needs for their project.
Once the Scriptlet has been referenced in the report, during the Filling stage of the Report Life Cycle, the JasperReports API will ensure to call the appropriate methods within the Scriptlet.
It is within these methods you will place your own logic to manipulate data in the report.
简言之,就是提供自定义操作(赋值,特殊运算处理等)!
例子:
例如某个变量AllCities需要特殊操作
1、在jrxml文件中,声明AllCities变量的时候,一定要将calculation设为"System"
如下所示:
<variable name="AllCities" class="java.lang.String" calculation="System"/>
2、在jrxml文件的标签jasperReport中,引用所使用的的scriptlets,如下所示:
scriptletClass="scriptlets.WebappScriptlet">
3、具体逻辑写到scriptlets的方法中
这些方法都是针对一些事件来写的!
- Scriptlet
- ireport scriptlet
- JSP-Scriptlet
- JasperReports Scriptlet介绍
- JSP语法(5)Scriptlet
- JSP语法 Scriptlet
- iReport+jasperReport 之scriptlet
- JSP基础----Scriptlet
- JSP 全局变量 scriptlet变量
- jsp中的scriptlet
- Scriptlet笔记1
- 3.JavaWeb基础 Scriptlet
- Applet、Scriptlet与Servlet
- scriptlet相关补充
- iReport+jasperReport 之scriptlet
- JSP中的Scriptlet
- JSP中的scriptlet和注释
- jsp参考(四) 脚本元素[scriptlet]
- ice3.3.1在fedora16上的安装
- GWT中如何将EMF对象存储为XMI/从XMI反序列化为对象
- js实现img src更新请求
- WM_DEVICECHANGE使用方法
- flex传递参数到server乱码问题
- Scriptlet
- js获取下拉列表中的name
- cursor
- 一篇故事讲述了计算机网络里的基本概念:网关,DHCP,IP寻址,ARP欺骗,路由,DDOS等...
- eclipse自动提示很慢、卡死情况处理
- Adroid--Activity生命周期(二)
- Tutorial: Storyboard in XCode 4.2 with Navigation Controller and Tabbar Controller (Part 1)
- Java设计模式圣经连载(02)-工厂方法(Factory Method)模式
- 一碗牛肉面的前世今生