Bug 35620 - URGENT --- "Unable to read file" error when processing HSSF files with more than 8 controls
Summary: URGENT --- "Unable to read file" error when processing HSSF files with more t...
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 2.5-FINAL
Hardware: Sun Solaris
: P1 blocker (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-05 22:33 UTC by AshokKumar Sankaran
Modified: 2005-08-25 07:57 UTC (History)
1 user (show)



Attachments
Excel file with eight command buttons (23.00 KB, application/octet-stream)
2005-07-05 22:35 UTC, AshokKumar Sankaran
Details
Excel file with nine command buttons (26.50 KB, application/octet-stream)
2005-07-05 22:36 UTC, AshokKumar Sankaran
Details

Note You need to log in before you can comment on or make changes to this bug.
Description AshokKumar Sankaran 2005-07-05 22:33:44 UTC
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------------------------------------------------
Comment 1 AshokKumar Sankaran 2005-07-05 22:35:51 UTC
Created attachment 15599 [details]
Excel file with eight command buttons

Excel file with eight command buttons
Comment 2 AshokKumar Sankaran 2005-07-05 22:36:26 UTC
Created attachment 15600 [details]
Excel file with nine command buttons

Excel file with nine command buttons
Comment 3 Jason Height 2005-08-25 05:37:42 UTC
WORKSFORME. At leats with the code in CVS HEAD. Maybe something got fixed recently.

A new release should be happening soon!

Jason
Comment 4 AshokKumar Sankaran 2005-08-25 15:57:09 UTC
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.