Jump to content

Recommended Posts

Posted

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

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted

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

Posted
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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...