ureport2报表的显示(前提已经配置好ureport2的相关配置文件)

1.http://localhost:8080/ICMP/ureport/designer访问报表设计首页,如图

2.选择数据源,选择第三种方式配置,级选择内部数据源,选择好,选择其中一个数据库表

 

接下来配置需要显示的字段,如图

配置好需要显示的字段以及报表样式,点击左上角的保存,在项目中会生成一个xml文件,一般是在web-inf文件下。

 

3.接下来通过网页显示配置好的报表,springmvc编写前端响应方法,

@RequestMapping(params = "xlBusLineUReport")
	public String xlBusLineUReport() {
	 return "base/line/LineReport/xlBusLineUReport";	 
	}

创建响应jsp页面xlBusLineUReport.jsp,需要jQuery插件包

<%@ page language="java" contentType="text/html; charset=utf-8"

         pageEncoding="utf-8"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<title>Insert title here</title>

<script type="text/javascript">

$("#commentIFrame").attr("src","${webRoot}/ureport/preview?_u=file:xl_bus_line.ureport.xml");

</script>

</head>

<body>

         <iframe onload="this.height=800" width="100%" scrolling="yes"

                   frameborder="0" src="" name="commentIFrame" id="commentIFrame" />

</body>

</html>

 

注意如果多条件查询的话,需要这样编写:

$("#commentIFrame").attr(   "src", "${webRoot}/ureport/preview?_u=file:xl_bus_line.ureport.xml&org_name="+ org_name + '&line_status='+ line_status+"&line_name="+lineName);

并且ureport2数据源数据库sql语句改为,必须定义默认参数,使用emptyparam函数,对参数是否为空进行判断

  • 1
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小明爱吃火锅

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值