资源描述:
《润乾报表参数传递.docx》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、准备环境MySql数据库,表跟数据如下,1表示男,0表示女drop table test_report; create table test_report( idint(10), name varchar(20), sexint(1), classes varchar(20), ageint(3), primary key(id));insert into test_report values(1, "张三",1, "高一(1)班",16);insert into test_report values(2, "张三2",1, "高一(2)班",16);insert into tes
2、t_report values(3, "张三3",1, "高一(3)班",16);insert into test_report values(4, "张三4",1, "高一(4)班",16);insert into test_report values(5, "张三5",1, "高一(5)班",16);insert into test_report values(6, "张三6",1, "高一(1)班",16);insert into test_report values(7, "张三7",1, "高一(2)班",16);insert into test_report value
3、s(8, "张三8",1, "高一(3)班",16);insert into test_report values(9, "张三9",1, "高一(4)班",16);insert into test_report values(10, "张三10",1, "高一(5)班",16);insert into test_report values(11, "张三11",1, "高一(1)班",16);insert into test_report values(12, "张三12",1, "高一(2)班",16);insert into test_report values(13, "张
4、三13",0, "高一(3)班",16);insert into test_report values(14, "张三14",0, "高一(4)班",16);insert into test_report values(15, "张三15",1, "高一(5)班",16);insert into test_report values(16, "张三16",1, "高一(1)班",16);insert into test_report values(17, "张三17",1, "高一(2)班",16);insert into test_report values(18, "张三18"
5、,1, "高一(1)班",16);insert into test_report values(19, "李四",1, "高一(1)班",17);在设计表的时候第一张为传递参数表第二张为根据参数查询出来的结果表新建报表确定选择填报或参数表单,生产空白报表设计表单为这种简单样式选中B1变量名字,定义为sex右键B1,选择填报属性选中下拉列表框点击设置增加2个数据库对应显示的值,确定,确定表单就设计好了,另存为param1.raq开始设计显示表单生产空白表单一样然后。配置数据源根据具体境况配置点击连接,显示已连接配置数据集增加选择复杂SQL,确定写SQL语句,带查询条件的定义查询条件的
6、参数跟类型,确定选择对应的数据源设计页面设置B2的为下拉列表对应的值如上,右键B2,选择下拉列表框,设置,增加2个代码1对应男0对应女,确定。另存报表为show.raqEOS项目中建立jsp页面test.jsp<%@page pageEncoding="UTF-8"%><%@include file="/common/common.jsp"%><%@include file="/common/skins/skin0/component.jsp" %><%@taglib prefix="report" uri="/WEB-INF/runqianReport4.tld"%>
7、
Title 启动EOS,访问test.jsp效果