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: [email protected]
        ReportedBy: [EMAIL PROTECTED]
                CC: [EMAIL PROTECTED]


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: [EMAIL PROTECTED]
Mailing List:    http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/

Reply via email to