jsp代码如下
<%@ page import="java.sql.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.io.*" %>
<%@ page import="net.sf.jasperreports.engine.JasperFillManager" %>
<%@ page import="net.sf.jasperreports.engine.JasperPrint"%>
<%@ page import="net.sf.jasperreports.engine.JRException"%>
<%@ page import="net.sf.jasperreports.engine.JasperRunManager"%>
<%@ page import="net.sf.jasperreports.engine.*"%>
<%
//连接到数据库
Connection conn = 连接数据库;
//装载jasper文件application
File exe_rpt = new File(application.getRealPath("/a.jasper"));
//id就是iReport的变量$P{id}的名称
Map parameters = new HashMap();
parameters.put("condition", (String)request.getAttribute("condition&#