分享一下项目中应用birt报表吧
首先下载:birt-runtime-2_3_1和birt-rcp-report-designer-2.1.2
我用的是eclipse3.3编辑器,那么这个版本就要使用birt-rcp-report-designer-2.1.2了,否则版本不兼容。
1、 首先在你的birt中创建你需要的报表文件,生成的文件位于你的birt-rcp-report-designer安装路径下的workspace下,后缀名是.rptdesign
2、 将.rptdesign文件copy到你的工程路径下
3、 接下来就是配置相应的项目应用了
A、 打开birt-runtime-2_3_1文件夹,将WebViewerExample文件夹下的WEB-INF文件夹放到你项目的对应位置,其中jrun.web.xml、weblogic.xml和web-template.xml不需要理会,需要注意的是将web.xml中的信息copy到你的web.xml中。
B、 创建jsp页面,内容如下:
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="utf-8"%>
<%@ taglib prefix="birt" uri="/WEB-INF/tlds/birt.tld" %>
<!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>报表</title>
</head>
<body>
<birt:report id="0"
top="100"
left="100"
width="800"
height="600"
reportDesign="testreport/test_report.rptdesign"
position="absolute"
format="html"
>
</birt:report>
</body>
</html>
遇到如下问题时:
Cannot open the connection for the driver: org.eclipse.birt.report.data.oda.jdbc.
Cannot load JDBC Driver class: oracle.jdbc.OracleDriver
解决办法是:在一下对应的路径\WEB-INF\platform\plugins\org.eclipse.birt.report.data.oda.jdbc_*中加载数据库驱动