Show a XLS file in a web application

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
aggelos's picture
203
Joined: Aug 4 2006 - 12:59am
Last seen: 8 years 3 months ago

2 Answers:

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
aggelos's picture
203
Joined: Aug 4 2006 - 12:59am
Last seen: 8 years 3 months ago
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.
ionutned's picture
367
Joined: Jul 17 2006 - 12:17am
Last seen: 16 years 8 months ago
Feedback
randomness