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 2006/08/22 19:41:00 UTC

DO NOT REPLY [Bug 40296] New: - HSSFCell.setCellFormula throws ClassCastException if cell is created using HSSFRow.createCell(short column, int type)

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=40296>.
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=40296

           Summary: HSSFCell.setCellFormula throws ClassCastException if
                    cell is created using HSSFRow.createCell(short column,
                    int type)
           Product: POI
           Version: 2.5
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HSSF
        AssignedTo: poi-dev@jakarta.apache.org
        ReportedBy: peterl@edmundsassoc.com


The following program throws ClassCastException at line 22. Error message states
"org.apache.poi.hssf.record.BoolErrRecord cannot be cast to
org.apache.poi.hssf.record.aggregates.FormulaRecordAggregate". Seems like there
may be a missing break near line 232 of HSSFCell. Thanks.

import java.io.*;
import org.apache.poi.hssf.usermodel.*;

public class FormulaTest {

  public static void main (String[] args) {

    try {
      FileOutputStream out = new FileOutputStream("FormulaTest.xls");

      HSSFWorkbook workBook = new HSSFWorkbook();
      HSSFSheet workSheet = workBook.createSheet("Sheet1");
      HSSFCell cell = null;
      HSSFRow row = null;

      row = workSheet.createRow(0);
      cell = row.createCell((short)0, HSSFCell.CELL_TYPE_NUMERIC);
      cell.setCellValue(1.0);
      cell = row.createCell((short)1, HSSFCell.CELL_TYPE_NUMERIC);
      cell.setCellValue(2.0);
      cell = row.createCell((short)2, HSSFCell.CELL_TYPE_FORMULA);
      cell.setCellFormula("SUM(A1:B1)");
      workBook.write(out);
      out.close();
    }
    catch(Exception ex) {
      ex.printStackTrace();
    }
  }
}

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


DO NOT REPLY [Bug 40296] - HSSFCell.setCellFormula throws ClassCastException if cell is created using HSSFRow.createCell(short column, int type)

Posted by bu...@apache.org.
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=40296>.
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=40296





------- Additional Comments From peterl@edmundsassoc.com  2006-08-22 19:18 -------
Created an attachment (id=18742)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=18742&action=view)
Test Case


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


DO NOT REPLY [Bug 40296] - HSSFCell.setCellFormula throws ClassCastException if cell is created using HSSFRow.createCell(short column, int type)

Posted by bu...@apache.org.
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=40296>.
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=40296


avik@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Additional Comments From avik@apache.org  2007-01-16 01:47 -------
Works as of 12Jan2007, Testcase added. 
http://issues.apache.org/bugzilla/show_bug.cgi?id=41366

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