i have developed application in JSF 1.2, RichFaces and running on Apache Tomcat. Have used JasperReports (with iReport 4) to generate pdf file from application and its perfectly ok. Now i want to export same files to excel instead of pdf. I used following code snippet but get error
net.sf.jasperreports.engine.JRException: java.io.FileNotFoundException: \reports\studentReports\testExcel.jrprint
The Code snippiet for generating to excel is as follows:-
File file = new File("/reports/studentReports/testExcel.jrprint");
JasperPrint jasperPrint = (JasperPrint)
JRLoader.loadObject(file);
JExcelApiExporter xlsExporter = new JExcelApiExporter();
xlsExporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
xlsExporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME,"/reports/studentReports" + "/" + "testExcel1" + ".xls");
System.out.println("Exporting report...");
xlsExporter.exportReport();
I have checked, the path to report is correct. Where am i doing wrong. Thanks in advance.