Ireport报表的问题
我有三张报表分别是医疗项目费用表,药品费用表,还有一个是固定费用表.
不知道怎么把三张报表怎么放到一个jsp页面里.我的代码如下.
<%@ page language= "java " import= "java.util.* " pageEncoding= "gbk "%>
<%@ page session= "false "%>
<%@ page import= "
net.sf.jasperreports.engine.* "%>
<%@ page import= "javax.naming.* "%>
<%@ page import= "java.sql.* "%>
<%@ page import= "java.sql.* "%>
<%@ page import= "javax.sql.* "%>
<%@ page import= "java.io.* "%>
<%@ page contentType= "text/html;charset=gb2312 "%>
<html>
<head>
<title> </title>
</head>
<body>
<%
String patient_id = request.getParameter( "patient_id ");
int pi = Integer.parseInt(patient_id);
%>
<div align= "left ">
<%
try {
File bussiness_rpt = new File(application
.getRealPath( "WEB-INF/repotrs/new_report.jasper "));
Map parameters = new HashMap();
parameters.put( "patientId ", pi);
parameters.put( "chargedate ", new java.util.Date());
Class.forName( "com.mysql.jdbc.Driver ");
String url = "jdbc:mysql://localhost/Hospital?user=root&password=123 ";
Connection conn = DriverManager.getConnection(url);
Statement stmt = conn.createStatement(
ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_UPDATABLE);
String sql = "SELECT * FROM medicine_item_charge_paitient where patient_id= "
+ pi;
ResultSet rs = stmt.executeQuery(sql);
byte[] bytes = JasperRunManager.runReportToPdf(bussiness_rpt
.getPath(), parameters, conn);
response.setContentType( "application/pdf ");
ServletOutputStream outputStream = response.getOutputStream();
outputStream.write(bytes, 0, bytes.length);
outputStream.flush();
outputStream.close();
out.clear();
out = pageContext.pushBody();
} catch (Exception ex) {
ex.printStackTrace();
}
%>
<%
try {
File bussiness_rpt = new File(application
.getRealPath( "WEB-INF/repotrs/new_report3.jasper "));
Map parameters = new HashMap();
Class.forName( "com.mysql.jdbc.Driver ");
String url = "jdbc:mysql://localhost/Hospital?user=root&password=123 ";
Connection conn = DriverManager.getConnection(url);
Statement stmt = conn.createStatement(
ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_UPDATABLE);
ResultSet rs = stmt.executeQuery( "SELECT * FROM fi