The following is my problem :- I have two simple excel files "eightcontrols.xls" and "ninecontrols.xls". "eightcontrols.xls" contains 8 command buttons. "ninecontrols.xls" contains 9 command buttons. The below code works fine with "eightcontrols.xls", but gives an "Unable to read file" error with "ninecontrols.xls" Also, we noticed there is a loss of size on the "ninecontrols.xls" run. Code------------------------------------------------ POIFSFileSystem fs = null; HSSFWorkbook wb = null; URL fileURL = context.getResource ("/xlfiles/eightcontrols.xls"); // Unix convention //URL fileURL = context.getResource ("c:\xlfiles\eightcontrols.xls"); // Windows convention InputStream in = fileURL.openStream(); fs = new POIFSFileSystem(in); wb = new HSSFWorkbook(fs); ByteArrayOutputStream output = new ByteArrayOutputStream(); try { wb.write(output); System.out.println("File Size = " + output.size()); wb.write(new FileOutputStream("c:/temp/test.xls")); response.reset(); response.setContentType("application/vnd.ms-excel"); response.setHeader("Content-Disposition","attachment; filename=\"" + filename + "\""); response.getOutputStream().write(output.toByteArray()); response.flushBuffer(); } catch (Exception e) { logger_.trace("Exception raised while producing Raw XL data for Vertical COMPS.."); e.printStackTrace(); } Code------------------------------------------------
Created attachment 15599 [details] Excel file with eight command buttons Excel file with eight command buttons
Created attachment 15600 [details] Excel file with nine command buttons Excel file with nine command buttons
WORKSFORME. At leats with the code in CVS HEAD. Maybe something got fixed recently. A new release should be happening soon! Jason
When do you think we can expect a new release. Is there any we can get the latest from CVS HEAD.? When HSSF is going to support Office 2002 or Office XP.