Jump to content
Changes to the Jaspersoft community edition download ×

Show a XLS file in a web application


aggelos

Recommended Posts

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

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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

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