ASF Bugzilla – Attachment 18742 Details for
Bug 40296
HSSFCell.setCellFormula throws ClassCastException if cell is created using HSSFRow.createCell(short column, int type)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Test Case
FormulaTest.java (text/plain), 862 bytes, created by
Peter Lachall
on 2006-08-22 19:18:40 UTC
(
hide
)
Description:
Test Case
Filename:
MIME Type:
Creator:
Peter Lachall
Created:
2006-08-22 19:18:40 UTC
Size:
862 bytes
patch
obsolete
>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(); > } > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 40296
: 18742