iReport 笔记(七) 为子报表添加统计信息
来源:互联网 发布:分光计实验数据 编辑:程序博客网 时间:2024/05/04 10:34
p {font-family: "宋体";font-size: 12px;font-style: normal;line-height: 18px;font-weight: normal;text-indent: 24px;}h1 {font-size: 36px;font-style: normal;font-weight: bold;text-decoration: underline;color: #990000;text-align: center;}h2 {font-size: 24px;font-weight: bold;color: #9900FF;}h3 {font-size: 18px;font-weight: bold;color: #000099;}a {color: #660033;text-decoration: none;}img {vertical-align: middle;}ul {font-family: "宋体";font-size: 12px;line-height: 18px;}PRE { font-size: 12px; padding: 5px; border-style: solid; border-width: 1px; border-color: #CCCCCC; background-color: #F0F0F0;}table {font-size: 12px;border-collapse: collapse;}tr {background-color: inherit;color: black;padding: 5px;text-align: left;border: 1px solid #999999;}th {text-align: center;background-color: #cccccc;color: black;font-weight: bolder;padding: 5px;border: 1px solid #999999;}td {border: 1px solid #999999;padding: 5px;}ol {font-family: "宋体";font-size: 12px;line-height: 18px;}h4 {font-size: 16px;}
为子报表添加统计信息
内容与上例基本相同,但在子报表中添加一些统计信息,最后结果如下图所示:
程序部分
首先,我修改一下ProvinceBean的定义,添加一个只读属性cityCount,如下代码中的阴影部分所示:
package lld.test.ireport;import java.util.ArrayList;public class ProvinceBean{private String provinceName;private ArrayList<CityBean> cities;public int getCityCount(){if(this.cities != null)return this.cities.size();elsereturn 0;}public String getProvinceName(){return provinceName;}public void setProvinceName(String provinceName){this.provinceName = provinceName;}public ArrayList<CityBean> getCities(){return cities;}public void setCities(ArrayList<CityBean> cities){this.cities = cities;}}
其余代码不作修改
报表部分
在主报表的“Java Bean Data Source”中,引入新添加的cityCount字段。
在主报表的子报表控件上,打开其属性窗口,添加“CITY_COUNT”参数,如下图所示:
打开子报表,添加参数“CITY_COUNT”(添加参数的方式为在左下角“Document structure”工具窗口的Parameters节点添加),如下图所示:
然后,修改子报表设计,添加summay栏(可通过右右键),如下图所示:
OK,本例至此完成。
注: 如需本例示例代码, 请留言
- iReport 笔记(七) 为子报表添加统计信息
- iReport 笔记(七) 为子报表添加统计信息
- iReport 笔记(七) 为子报表添加统计信息 【转】
- iReport 笔记(八) 添加统计信息
- iReport 笔记(八) 添加统计信息
- iReport 笔记(八) 添加统计信息 【转】
- IReport添加报表分组与分组统计
- ireport子报表
- ireport子报表数据源
- Ireport子报表总结
- Ireport子报表总结
- ireport 子报表制作过程
- IReport的子报表设置
- 利用iReport制作子报表
- ireport 子报表 返回参数
- IReport报表分组与分组统计
- iReport 4.1 报表、子报表、主从报表、合计、实例解析
- iReport 报表、子报表、主从报表、合计、实例解析
- Hibernate中get和load方法的区别
- 展望下一代互联网应用平台
- 有多少网民成了别人的木偶?
- 极限编程实践
- 纯粹简单的程序员
- iReport 笔记(七) 为子报表添加统计信息
- 自己动手写 HTTP Server
- 似的发三等分
- 夏娃的诱惑
- 火影忍者370
- 梦幻西游qq表情包YR
- 火影忍者246集视频VW
- Dota英雄装备配置(转)
- qianqianjingtingYW