Hi! As part of an ongoing project, I've provided a link for users to 
download data in Excel format. This link actually calls a JSP, which 
performs the necessary work to collect the data. The data is then loaded 
into an Excel workbook (with multiple) sheets and is formatted as per the 
users' requirements (colors, fonts, data formats, etc.). 

Things almost work as expected. The first 2-3 downloads are as expected. 
Then, from the next time onwards, the downloaded Excel file does not have 
any formatting in it and/or the formatting goes wild (colors, fonts, etc. 
appear in unexpected places). On my development setup, I've noticed that 
restarting the server usually causes things to back to normal. Of course, 
this cannot be a solution for production purposes. 

Here's the setup: I'm using Websphere Studio Application Developer on a NT 
machine for development. The target environment is an AIX/Websphere combo. 
After the workbook object is created & populated, I write it to a 
ByteArrayOutputStream. Then I use the toByteArray() method to get the 
contents as a byte array which is ultimately downloaded as an Excel file, 
using the output stream of the response. The header content type is set 
to "application/msexcel". The header is set to "Content-Disposition", with 
the default name of the download file specified (eg. myData.xls). The 
content length is set to the size of the byte array. 

The question: how do I go about ensuring that every time a user attempts to 
download data, they see it with the proper formatting? Am I doing something 
incorrect to cause this behavior? 

Please help soon, I've got my back to the wall! 

Cheers! 

-- Amol. 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to