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.





------- Additional Comments From [EMAIL PROTECTED]  2003-01-15 16:57 -------
Here is the code that corrupts the xls file (1/15/03 16:53 attachment to this 
bug report) when using the 1.9.0 nightly build from 20030115:

    public void poiXlsTest() {      
      
      try {
    POIFSFileSystem fs      =
            new POIFSFileSystem(new FileInputStream
("/usr/local/data/dashView.xls"));
    HSSFWorkbook wb = new HSSFWorkbook(fs);
    HSSFSheet sheet = wb.getSheetAt(0);
    
    HSSFRow row = sheet.getRow(5);
    HSSFCell cell = row.getCell((short)3);
    if (cell == null)
        cell = row.createCell((short)3);
        
        // Write test
    cell.setCellType(HSSFCell.CELL_TYPE_STRING);
    cell.setCellValue("a test");

        // change existing numeric cell value
    log.debug("change existing numeric cell");
    HSSFRow oRow = sheet.getRow(14);
    HSSFCell oCell = oRow.getCell((short)4);
    oCell.setCellValue(75);
    oCell = oRow.getCell((short)5);
    oCell.setCellValue("0.3");
    
    // Write the output to a file
    FileOutputStream fileOut = new FileOutputStream("/usr/local/data/dashView-
1.xls");
    wb.write(fileOut);
    fileOut.close();
  }
  catch (java.io.FileNotFoundException ex)
  {
    log.error(ex.getMessage());
  }
  catch (java.io.IOException ex)
  {
    log.error(ex.getMessage());
  }
  
  }

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to