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
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
2 Answers:
Posted on August 15, 2006 at 8:10pm
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
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