You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2005/07/05 22:33:48 UTC

DO NOT REPLY [Bug 35620] New: - URGENT --- "Unable to read file" error when processing HSSF files with more than 8 controls

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=35620>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=35620

           Summary: URGENT --- "Unable to read file" error when processing
                    HSSF files with more than 8 controls
           Product: POI
           Version: 2.5
          Platform: Sun
        OS/Version: Solaris
            Status: NEW
          Severity: blocker
          Priority: P1
         Component: HSSF
        AssignedTo: poi-dev@jakarta.apache.org
        ReportedBy: ashokkumar.sankaran@chase.com
                CC: ashokkumar.sankaran@chase.com


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------------------------------------------------

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
Mailing List:    http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/