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 2002/12/14 23:03:07 UTC

DO NOT REPLY [Bug 15375] New: - Post 1.5.1 POI causes spreadsheet to become unopenable.

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

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15375

Post 1.5.1 POI causes spreadsheet to become unopenable.

           Summary: Post 1.5.1 POI causes spreadsheet to become unopenable.
           Product: POI
           Version: 2.0-dev
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Blocker
          Priority: Other
         Component: HSSF
        AssignedTo: poi-dev@jakarta.apache.org
        ReportedBy: greggarson@hotmail.com


When modifying an Excel 2000 Spreadsheet to add extra rows and columns the code 
completes as expected but causes either an 'Unable to open file' message from 
Excel or for the spreadsheet to briefly flash on screen and then disappear.

The code that causes this problem is:

String[][] accountCodes = dataHandler.getAcctCodeList(data.getCostCenter());
        HSSFCell cell = null;
        HSSFCellStyle cellStyle = null;
        HSSFRow row = sheet.getRow(rowPos);
        String[] accountCode = null;
        int a = 0;
        row = sheet.createRow((short)(rowPos));
        cell = row.createCell((short)cellPos);
        cell.setCellType(HSSFCell.CELL_TYPE_STRING);
        cell.setCellStyle(headerStyle);
        cell.setCellValue("Account Code (and description)");
        a++;
        for(;(accountCodes != null) && (a<=accountCodes.length-1);a++){
            accountCode = accountCodes[a];
            //Fails when adding this row
            row = sheet.createRow((short)(rowPos+a));
            cell = row.createCell((short)cellPos);
            cell.setCellType(HSSFCell.CELL_TYPE_STRING);
            cell.setCellStyle(bodyStyle);
            cell.setCellValue(accountCode[0] + " - " + accountCode[1]);
        }
        return a;

This is not a problem in 1.5.1