2005 IR Help Posted August 22, 2006 Share Posted August 22, 2006 By: naveen - naveen_bensily Problem with exporting Excel file 2004-02-17 05:17 i am getting a exception when i am generating a excel file .The code which i am using is below File sFile = new File(repTempFill); JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(sFile); File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".xls"); JRXlsExporter exporter = new JRXlsExporter(); exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, destFile.toString()); exporter.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.TRUE); exporter.exportReport(); System.out.println("Report created"); When it comes to the exporter method it gives the exception .Pls help le java.lang.ClassCastException: java.lang.String at dori.jasper.engine.export.JRXlsExporter.exportReport(JRXlsExporter.java:259) at com.sysarris.report.CreateReport.convertExcel(CreateReport.java:230) at com.sysarris.report.CreateReport.buildReport(CreateReport.java:304) at com.sysarris.report.CreateReport.doPost(CreateReport.java:108) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106) at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42) at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:241) at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:527) at jrun.servlet.http.WebService.invokeRunnable(WebService.java:172) at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:348) at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:451) at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:294) at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now