J2EE项目中应用Birt报表

 

分享一下项目中应用birt报表吧

首先下载:birt-runtime-2_3_1birt-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.xmlweblogic.xmlweb-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_*中加载数据库驱动

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值