jasperreport生成报表的值为null
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>TestReport</title>
<style type="text/css">
<!--
.STYLE1 {font-size: 36px}
.style7 {color: #FF0000}
-->
</style>
</head>
<body>
<%@ page import="net.sf.jasperreports.engine.*"%>
<%@ page import="net.sf.jasperreports.engine.util.*"%>
<%@ page import="net.sf.jasperreports.engine.export.*"%>
<%@ page import="java.util.*"%>
<%@ page import="java.io.*"%>
<%@ page import="java.sql.*"%>
<%
final String DATABASE_URL ="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=DataOperationPlatform";
final String DATABASE_USER ="sa";
final String DATABASE_PASSWORD ="";
Connection conn=null;
Statement stmt=null;
ResultSet rs=null;
String fileName="";
try
{
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
}catch(ClassNotFoundException e)
{
out.println(e.getMessage());
}
try
{
conn=DriverManager.getConnection(DATABASE_URL,DATABASE_USER,DATABASE_PASSWORD);
File reportFile = new File(application.getRealPath("FirstReport.jasper"));
Map parameters = new HashMap();
//parameters.put("filename","111");
byte[] bytes = JasperRunManager.runReportToPdf(reportFile.getPath(), parameters,new JREmptyDataSource());
response.setContentType("application/pdf");
response.setContentLength(bytes.length);
FileOutputStream fos=new FileOutputStream("c:\\MyReport.pdf");
fos.write(bytes);
fos.close();
}
catch (SQLException ex)
{
ex.printStackTrace();
}
catch (JRException e)
{
e.printStackTrace();
}
%>
</body>
</html>
大家帮我看看为什么生成报表的值都为null.调试了一天了.