posted 12 years ago
0 down vote favorite
share [g+] share [fb] share [tw]
I am working on the export functionality in the Apache POI. The "Export to xls" colour functionality is not working in the MS Excel where as it is working in the Open Office.
I am trying to export using the ServletOutputStream and accordingly trying to get the desired "Coloured Cell" on the Excel Sheet.
The coloured cell is being shown in the Open Office but is not being shown in the MS Excel.
Code Which i am using for writing a file:--
response.setContentType("application/xls");
response.setContentLength( myWorkBook.getBytes().length);
response.setHeader("Content-Disposition", "attachment;filename=Report.xls");
response.getOutputStream().write( myWorkBook.getBytes(), 0, myWorkBook.getBytes().length);
response.getOutputStream().flush();
response.getOutputStream().close();
Please Help