我们已经有了一个Javaweb应用,现在要实现对报表的集成

我的应用是这个样子的 

说明:

1)  这里使用的是birt4.4版本的, 下载birt-runtime-4.4.zip(在官方下载),然后将birt.war解压,可以看到 logs report scriptlib webcontent WEB-INF **.jsp **.rptdesign 这些文件及文件夹

2) 将 WEB_INF下的内容放到我们自己的web应用的WEB-INF相应的目录下,将它的web.xml与我们应用的web.xml内容进行合并,birt里面的web.xml的具体配置见文档

3) birt的webcontent目录官方上一定要放到web应用的根目录的,如果要放到自己指定的目录,比如说我自己应用里面的birt目录,你需要修改birt的jar中的viewsevlets.jar中的三个类  : org.eclipse.birt.report.servlet.ViewerServlet.java   org.eclipse.birt.report.servlet.BirtEngineServlet.java   org.eclipse.birt.report.taglib.ParamDefTag.java (需要用到反编译工具 ,我这里用的是 jd-gui.exe )

4) 设计好自己的报表或者报表模板,放到配置文件指定的路径,我这里就在birt目录下,如上面的 eastcom_test_report.rpttemplate

5)我们自己的jsp页面是直接跳转到birt引擎进行处理的

<s:form id="MYFORM" action="/frameset" method="post" theme="simple">
<div id="content">
<table>
<tr>
<th width="13%"><span>*</span>模板名称:</th>
<td width="35%"><div>
<s:textfield name="reportDesign.name" maxlength="128" readonly="true" />
</div></td>

<th width="17%"><span>*</span>模板路经:</th>
<td width="35%"><div>
<s:textfield name="reportDesign.designLocation" maxlength="128" readonly="true" />
</div></td>
</tr>

<tr>
<th colspan="4" style="text-align:center;"><span>请设置以下报表参数</span></th>
</tr>
<tr>
<th colspan="4" >&nbsp;</th>
</tr>

<tr>
<th width="13%"><span>*</span>资源Key:</th>
<td width="35%">
<div>

<s:textfield name="resource_key" maxlength="128" onblur="Check.required(this)"/>

<s:hidden name="__report" value="%{reportDesign.designLocation}"></s:hidden>  ,这是指定具体的模板名称,它会到我们放模板或者报表的路径下去匹配的
</div></td>
</tr>

</table>
</div>
<div id="operator">
<div class="left"></div>
<div class="middle" onclick="Page.submit(true)">提交</div>
<div class="right"></div>
<div class="left"></div>
<div class="middle" onclick="Page.close()">关闭</div>
<div class="right"></div>
</div>
</s:form>

6) 如果要发布到websphere服务器上,需要在lib中加入 itext.1.3.jar  ,tomcat jetty是不能加的

birt 集成到现有的web应用中的更多相关文章

  1. 如何在现有的 Web 应用中使用 ReactJS

    原文:How to Sprinkle ReactJS into an Existing Web Application 译者:nzbin 当我们学习一项新技术,可能是一个 JavaScript 框架, ...

  2. 细说shiro之四:在web应用中使用shiro

    官网:https://shiro.apache.org/ 1. 下载在Maven项目中的依赖配置如下: <!-- shiro配置 --> <dependency> <gr ...

  3. Java Web学习系列——Maven Web项目中集成使用Spring、MyBatis实现对MySQL的数据访问

    本篇内容还是建立在上一篇Java Web学习系列——Maven Web项目中集成使用Spring基础之上,对之前的Maven Web项目进行升级改造,实现对MySQL的数据访问. 添加依赖Jar包 这 ...

  4. 06_在web项目中集成Spring

    在web项目中集成Spring 一.使用Servlet进行集成测试 1.直接在Servlet 加载Spring 配置文件 ApplicationContext applicationContext = ...

  5. react native 之 在现有的iOS工程中集成react native

    在现有的iOS工程中集成react native, 或者说将react native引入到iOS 项目,是RN和iOS混合开发的必经之路 参考官网教程:https://reactnative.cn/d ...

  6. IDEA下集成tomcat7插件将tomcat内嵌到web项目中

    新建一个maven web项目 修改pom.xml文件 <build> <plugins> <!-- 配置Tomcat插件: 就是本地部署,将tomcat 内嵌到 web ...

  7. 如何把Power BI嵌入到Web应用中

    (此文章同时发表在本人微信公众号"dotNET开发经验谈",欢迎右边二维码来关注.) 题记:这篇其实不是一个操作向导了,主要对Power BI的嵌入特性进行探讨. Power BI ...

  8. 如何把Qlik Sense嵌入到Web应用中

    (此文章同时发表在本人微信公众号"dotNET开发经验谈",欢迎右边二维码来关注.) 题记:这是一个给初学者(尤其对VS不熟悉的BI工程师)的入门操作向导. Qlik Sense是 ...

  9. web自动化测试中绕开验证码登陆的方式

    web自动化测试中登陆需验证码是很大的一个困扰.现推荐一种简单的避开验证码登陆的方式,先代码进入登录页,人工输入验证码登录后浏览器自动保存cookie,再在新的标签中登录. 具体代码如下: publi ...

随机推荐

  1. How to sort the dictionary by the value field

    // Sort dictionary by the value field List<KeyValuePair<int, int>> redBallsList = redBal ...

  2. 有了 indexOf,为什么 ECMAScript 7 还添加了 Array.prototype.include

    ECMAScript 7 中新增了用于检测数组中是否包含某个元素 Array.prototype.includes() API,想到了 Array 其实有很多相关 API 可以检测到是否包含某个元素, ...

  3. 常用px,pt,em换算及区别

    pt (point,磅):是一个物理长度单位,指的是72分之一英寸. px (pixel,像素):是一个虚拟长度单位,是计算机系统的数字化图像长度单位,如果px要换算成物理长度,需要指定精度DPI(D ...

  4. MatplotLib常用基本操作

    本文记录matlibplot常用基本操作,都是基本功能,不涉及复杂联合操作,其中各用法详细用法可参考官网: 1. 基本画图操作 ##mofan_matplotlib.pyplot import mat ...

  5. [2015-10-11]常用git命令

    从vs2013开始,vs已经对git的操作提供了很好的支持,但是重度使用时还是会遇到很多抽风的时候,在此记录一些常用命令. 分支操作 查看所有远程分支 git branch -r 查看本地分支 git ...

  6. WebStorm ES6 语法支持设置&babel使用及自动编译

    一.语法支持设置 Preferences > Languages & Frameworks > JavaScript 二.Babel安装 1.全局安装 npm install -g ...

  7. 错误:Warning: Attempt to present <UIAlertController: 0x7fd192806e20> on <ViewController: 0x7fd1928048d0> whose view is not in the window hierarchy!

    系统:mac OS  10.12 (16A323) Xcod:8.3.3 错误:Warning: Attempt to present <UIAlertController: 0x7fd1928 ...

  8. spring配置datasource三种方式

    详见:http://blog.yemou.net/article/query/info/tytfjhfascvhzxcytp34 spring配置datasource三种方式 1.使用org.spri ...

  9. 第1阶段——uboot分析之仿照bootm制作hello命令(7)

    仿照bootm命令生成来制作一个hello命令,功能:打印出hello,world!和参数值 1.点击New File ,创建cmd_hello.c将./common/cmd_bootm.c的头文件复 ...

  10. MyEclipse使用(一)

    一.配置 window ----> preferences (1)配置 JDK java--->Installed JREs --> Add ---> JRE name --- ...