第3个回答 2012-01-25
为什么不直接用servlet?
if ("pdf".equals(strfiletype.trim())) {//导出pdf
System.out.println("导出pdf.........");
byte[] bytes = JasperRunManager.runReportToPdf(reportFile
.getPath(), parameters, conn);
response.setContentType("application/pdf");
response.setContentLength(bytes.length);
String filename = null;
if(exportFileName != null && !exportFileName.equals("")){
filename = exportFileName + ".pdf";本回答被提问者采纳