ireport导出word各种报错,不废话,直接上代码
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
String dbUrl = "jdbc:oracle:thin:@11.131.45.243:1521:disdb";
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection conn=DriverManager.getConnection(dbUrl,"dma_dis","dma_dis");

ServletContext  context=this.getServletContext();
String templatePath="/jaspertemplate/projecttemplate/";
HttpServletRequest request=ServletActionContext.getRequest();
String prjNo = request.getParameter("prjNo");
String path1="";


path1=context.getRealPath(templatePath+"project_examine_main.jasper");
String jrprintFile = new String(templatePath + "project_examine_main.jrprint");
System.out.println("path1=="+path1);

Map<String,Object> map1=new HashMap<String, Object>();
map1.put("prjNo", prjNo);

JasperPrint print1=JasperFillManager.fillReport(path1, map1,conn);
ArrayList<JasperPrint> jasperPrintList = new ArrayList<JasperPrint>();
jasperPrintList.add(print1);


this.getResponse().setContentType("application/msword;charset=utf-8");
this.getResponse().setHeader("Content-disposition", "attachment; filename="+ "1.doc");
JRExporter exporter = new JRRtfExporter();
exporter.setParameter(JRExporterParameter.JASPER_PRINT,print1);
// exporter.setParameter(JRExporterParameter.JASPER_PRINT_LIST,jasperPrintList);
exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, this.getResponse().getOutputStream());
exporter.exportReport();代码如上,在最后一行exporter.exportReport(); 一直报错,求大神指教一下,或者有其他的ireport导出word的代码发来参考一下,不胜感激ireport导出word