Re: Create and display the Excel file(.xls) using java (poi.jar)
Re: Create and display the Excel file(.xls) using java (poi.jar)
- Subject: Re: Create and display the Excel file(.xls) using java (poi.jar)
- From: "pavan.jayam" <email@hidden>
- Date: Thu, 24 Nov 2011 11:31:05 +0530
Hi,
The issue got resolved. Now i am downloading the excel file from the
response
------------------------------------------------------------------------------------------------
HSSFWorkbook workbook = new HSSFWorkbook();
--------------------
--------Code here------
-------------------
ByteArrayOutputStream out = new ByteArrayOutputStream();
workbook.write(out);
byte[] b = out.toByteArray();
excelData = new NSData(b);
aResponse.setHeader("application/vnd.ms-excel", "Content-Type");
aResponse.setHeader("Content-Disposition", "attachment; filename="+file);
aResponse.appendContentData(excelData);
------------------------------------------------------------------------------------------------
pavan.jayam wrote:
Hi List,
My requirement is to create an excel sheet using java and i need to
display the excel sheet in the client browser or need to provide an
option to open with or save file option in the client window.
I am able to create an excel workbook using poi.jar with the collected
data from database and i can store the excel file(.xls) in the web
server. But i am unable to view/display the excel sheet in browser.
Regards,
Pavan J.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden