aggelos Posted August 12, 2006 Share Posted August 12, 2006 Hi, i'm programming a web application and i have to show a xls report to the user ...i just create the report and it's working ok...but i don't know how to show the xls file created by jasper. please...somebody knows how can i do that? Thanks, Viviana Link to comment Share on other sites More sharing options...
aggelos Posted August 16, 2006 Author Share Posted August 16, 2006 if someone more needs it I could solve it by myself. I just create a servlet and in its post method after i just compiled, filled and run, the report i did:OutputStream out = response.getOutputStream();File xls = new File(fileName);InputStream in = new FileInputStream(xls);HSSFWorkbook wb = new HSSFWorkbook(in);response.setContentType("application/vnd.ms-excel");wb.write(out);out.flush(); it woks very goog but I don't know if there be a better form to do it, if there is it please notify me. Thanks, Viviana Link to comment Share on other sites More sharing options...
ionutned Posted August 16, 2006 Share Posted August 16, 2006 JasperReports provides a few servlet implementations for viewing reports exported to PDF, RTF or XLS. You can find these servlets in the net.sf.jasperreports.j2ee.servlets package. 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