[quote]
用eclipse3.6 开发web的birt需要:
第一步:到[url]http://www.eclipse.org/downloads/[/url]下载
[color=red]Eclipse IDE for Java and Report Developers 工具[/color]
第二步:[url]http://archive.eclipse.org/birt/downloads/drops/R-R1-2_3_0-200806191030/birt-wtp-integration-sdk-2_3_0.zip[/url]下载birt wtp插件 并安装
[/quote]
[size=large]开始项目的创建:[/size]
[quote]
1.新建一“web project with birt runtime” 名为ReportWeb
[img]http://dl.iteye.com/upload/picture/pic/68754/bc71b9a2-b1da-332e-9490-dd890d65a411.jpg[/img]
2.如图设置:
[img]http://dl.iteye.com/upload/picture/pic/68760/6f78052e-da24-3e09-8cce-d62c35c00f08.jpg[/img]
3.启动tomcat 服务,
访问网址:http://localhost:8080/ReportWeb/frameset?__report=test1.rptdesign&sample=my+parameter
[img]http://dl.iteye.com/upload/picture/pic/68758/b9b1fb81-3138-37fd-91f4-c29f95789380.jpg[/img]
(此为简单示例)
4.在jsp页面引入已经设计好的报表:
新建一jsp页面在webContent目录下:testreport.jsp,内容如下:
5.启动服务,访问地址:http://localhost:8080/ReportWeb/testreport.jsp
即可通过对应的按钮导出相应的格式
[img]http://dl.iteye.com/upload/picture/pic/68756/43a686ec-dea7-338c-b883-3e4ed872cb74.jpg[/img]
[/quote]
用eclipse3.6 开发web的birt需要:
第一步:到[url]http://www.eclipse.org/downloads/[/url]下载
[color=red]Eclipse IDE for Java and Report Developers 工具[/color]
第二步:[url]http://archive.eclipse.org/birt/downloads/drops/R-R1-2_3_0-200806191030/birt-wtp-integration-sdk-2_3_0.zip[/url]下载birt wtp插件 并安装
[/quote]
[size=large]开始项目的创建:[/size]
[quote]
1.新建一“web project with birt runtime” 名为ReportWeb
[img]http://dl.iteye.com/upload/picture/pic/68754/bc71b9a2-b1da-332e-9490-dd890d65a411.jpg[/img]
2.如图设置:
[img]http://dl.iteye.com/upload/picture/pic/68760/6f78052e-da24-3e09-8cce-d62c35c00f08.jpg[/img]
3.启动tomcat 服务,
访问网址:http://localhost:8080/ReportWeb/frameset?__report=test1.rptdesign&sample=my+parameter
[img]http://dl.iteye.com/upload/picture/pic/68758/b9b1fb81-3138-37fd-91f4-c29f95789380.jpg[/img]
(此为简单示例)
4.在jsp页面引入已经设计好的报表:
新建一jsp页面在webContent目录下:testreport.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>Insert title here</title>
</head>
<script type="text/javascript">
function expDoc() {
window.open("/ReportWeb/frameset?__report=test1.rptdesign&sample=my+parameter&__masterpage=true&__format=doc");
}
function expExcel() {
window.open("/ReportWeb/frameset?__report=test1.rptdesign&sample=my+parameter&__masterpage=true&__format=xls");
}
function expPDF() {
window.open("/ReportWeb/frameset?__report=test1.rptdesign&sample=my+parameter&__masterpage=true&__format=pdf");
}
</script>
<body>
<birt:report id="0"
top="100"
left="100"
width="800"
height="600"
reportDesign="test1.rptdesign"
position="absolute"
format="html">
</birt:report>
<input type="button" value="保存成word" onclick="javaScript:expDoc();"/>
<input type="button" value="保存成Excel" onclick="javaScript:expExcel();"/>
<input type="button" value="保存成PDF" onclick="javaScript:expPDF();"/>
</body>
</html>
5.启动服务,访问地址:http://localhost:8080/ReportWeb/testreport.jsp
即可通过对应的按钮导出相应的格式
[img]http://dl.iteye.com/upload/picture/pic/68756/43a686ec-dea7-338c-b883-3e4ed872cb74.jpg[/img]
[/quote]