本站首页    管理页面    写新日志    退出

The Neurotic Fishbowl

[Java报表软件—技术知识]Java报表软件数据钻取在一个页面展开
FineReport——报表技术领跑者 发表于 2011/7/30 11:43:45

       有一些客户希望在一个页面打开数据钻取的全部内容,这个功能可以利用iframe在自定义浏览界面解决,下面以一个简单的例子来说明: 1.         创建子模板son 1.1          打开Java报表软件设计器,新建工作簿,添加参数获取数据集SELECT * FROM STSCORE where classno = '${class}',设置参数class默认值Class1,合并A1至F12单元格,插入柱状图,绑定数据如下表: 500)this.width=500'>  1.2          下一步去掉iframe里的工具栏:打开报表|报表Web属性|分页预览设置,清空所有按钮,取消页面样式 1.3          保存模板到%FR_HOME%\WebReport\WEB-INF\reportlets\son.cpt   2.         创建主模板father      2.1   新建工作簿,获取数据集SELECT * FROM STSCORE,配置数据如下表: 500)this.width=500'> 2.2  右击A2单元格,设置超级链接,增加网络报表1,选择网络报表%FR_HOME%\WebReport\WEB-INF\reportlets\son.cpt。取消显示在原有报表页面的勾选,在网络报表页面显示样式右边的空白输入inner2,插入报表参数class的值为A2,如图 500)this.width=500'>   2.3   去掉iframe里的工具栏,具体操作同子模板son 2.4   稍作美观,保存模板到%FR_HOME%\WebReport\WEB-INF\reportlets\father.cpt   3.         创建HTML文件iframe.html,源代码如下: <html> <head> <title>自定义浏览页面</title> <meta http-equiv="Content-Type" content="text/html; charset=GBK"> <script type="text/javascript" src="/WebReport/ReportServer?op=resource&resource=/com/fr/web/jquery.js"></script> <script type="text/javascript"> window.onload = function(){        reportFrame = document.getElementById("reportFrame").contentWindow.contentPane;        reportFrame.on("afterload", function(){                 // currentPageIndex是从1开始的            var cPageIndex = reportFrame.currentPageIndex;               var pv = "第" + cPageIndex + "页/共" + reportFrame.reportTotalPage +  "页";             $("#pnum").val(pv);        }); } </script> </head>   <body> <div id="toolbar" >     <button type="button" onclick="reportFrame.gotoFirstPage()">首页</button> <button type="button" onclick="reportFrame.gotoPreviousPage()">上一页</button>     <input id="pnum" type="text" readonly="true" style="width:80px">  <button type="button" onclick="reportFrame.gotoNextPage()">下一页</button>     <button type="button" onclick="reportFrame.gotoLastPage()">末页</button>     <button type="button" onclick="reportFrame.pageSetup()">页面设置</button>     <button type="button" onclick="reportFrame.pdfPrint()">客户端PDF打印</button> <button type="button" onClick="reportFrame.flashPrint()">客户端FLASH打印</button>  <button type="button" onclick="reportFrame.printReportServer()">服务器打印</button>  <button type="button" onClick="reportFrame.exportReportToExcel('page')">导出[Excel](分页)</button> <button type="button" onClick="reportFrame.exportReportToWord()">导出[Word]</button> <button type="button" onclick="reportFrame.exportReportToPDF()">导出[PDF]</button>     <button type="button" onclick="reportFrame.emailReport()">邮件</button>   </div> <p align="center">        <iframe id="reportFrame" src="/WebReport/ReportServer?reportlet=father.cpt" frameborder="0"  width = "800" height = "128" ></iframe>        <iframe id="inner2" name="inner2" frameborder="0" width = "800" height = "300"></iframe>        </p> </body> </html> 注意:其中代码<iframe id="inner2" name="inner2" frameborder="0" width = "800" height = "300"></iframe>表示把主模板链接的子模板显示在一个iframe中   4.       预览 打开内置服务器,在浏览界面输入URL地址: http://localhost:8075/WebReport/iframe.html,效果如图:  500)this.width=500'>   这样,链接的报表直接出现在了被链接的报表下面 文章转自:http://blog.vsharing.com/fanfanzheng/A1385794.html

阅读全文(1716) | 回复(0) | 编辑 | 精华

 



发表评论:
昵称:
密码:
主页:
标题:
验证码:  (不区分大小写,请仔细填写,输错需重写评论内容!)

 
 



The Neurotic Fishbowl

.: 公告

本博客提供详细的java报表软件的制作过程,发布java报表软件的版本更新信息,并适时对国内主流报表软件进行功能比较。


Bloginess

«August 2025»
12
3456789
10111213141516
17181920212223
24252627282930
31

.: 我的分类(专题)

首页(357)
Java报表软件—制作笔记(54)
Java报表软件—功能比较(43)
Java报表软件—使用心得(21)
Java报表软件—行业动态(54)
Java报表软件—新闻资讯(48)
Java报表软件—技术知识(49)
Java报表软件—问题解析(2)


In the Bowl

.: 最新日志

如何对报表的参数控件赋值
java报表工具FineReport常见
报表怎么做 FineReport连接池原
报表怎么做FineReport数据连接之
报表模板之报表设计
报表模板之报表设计


.: 最新回复

回复:报表参数
好好学习,
好好学习,天天向上。买双 air jor
回复:理解FineReport缓存系列2
回复:理解FineReport缓存系列2


The Fishkeeper
blog名称:Java报表软件
日志总数:357
评论数量:69
留言数量:0
访问次数:1208857
建立时间:2006年4月16日



Text Me

.: 留言板

签写新留言

需要你的帮助


Other Fish in the Sea

.: 链接

报表开发工具  html5图表java报表开发工具




站点首页 | 联系我们 | 博客注册 | 博客登陆

Sponsored By W3CHINA
W3CHINA Blog 0.8 Processed in 0.043 second(s), page refreshed 144761299 times.
《全国人大常委会关于维护互联网安全的决定》  《计算机信息网络国际联网安全保护管理办法》
苏ICP备05006046号