1. 設計器鏈接mysql數據庫, 建立first.raq報表文件html
2. 建立demo.jsp,嵌入報表,jsp頂部加入下面兩行java
<%@ page contentType="text/html;charset=GBK" %> <%@ taglib uri="/WEB-INF/runqianReport4.tld" prefix="report"%>
3. 將快逸目錄下的webapps文件夾裏的quiee文件夾複製到Tomcat目錄下的webapps文件夾下
4. 將quieeReport\jdbc文件夾下的mysql-connector-java-5.1.5-bin.jar(mysql數據庫的JDBC驅動包)拷貝到Tomcat目錄下lib文件夾下mysql
5. 而後配置Tomcat6的數據庫鏈接池,打開Tomcat6目錄conf文件夾下server.xml,在</Host>以前添加以下代碼:web
<Context path="/quiee" docBase="quiee" debug="0" privileged="true"> <Resource name="jdbc/report" auth="Container" type="javax.sql.DataSource" maxActive="10" maxIdle="30" maxWait="10000" username="root" password="" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://127.0.0.1:3306/report" /> </Context>
6. 修改報表參數文件 將quiee/WEB-INF/reportConfig.xml 的dataSource節點修改成sql
<config> <name>dataSource</name> <value> jdbc/report,mysql;</value> </config>
7. 將quiee/WEB-INF/web.xml用下面的代碼替換數據庫
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://Java.sun.com/dtd/web-app_2_3.dtd"> <web-app> <servlet> <servlet-name>reportServlet</servlet-name> <servlet-class> com.runqian.report4.view.ReportServlet </servlet-class> <init-param> <param-name>configFile</param-name> <param-value>/WEB-INF/reportConfig.xml</param-value> </init-param> <load-on-startup>2</load-on-startup> </servlet> <servlet-mapping> <servlet-name>reportServlet</servlet-name> <url-pattern>/reportServlet</url-pattern> </servlet-mapping> <taglib> <taglib-uri>/WEB-INF/runqianReport4.tld</taglib-uri> <taglib-location>/WEB-INF/runqianReport4.tld</taglib-location> </taglib> </web-app>
8. 啓動tomcat,查看效果 http://localhost:8080/quiee/jsp/demo.jsptomcat