poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 15038] New: - #VALUE! Result from Formula in spreadsheet
Date Tue, 03 Dec 2002 23:15:18 GMT
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=15038>.
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=15038

#VALUE! Result from Formula in spreadsheet

           Summary: #VALUE! Result from Formula in spreadsheet
           Product: POI
           Version: 2.0-dev
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: HSSF
        AssignedTo: poi-dev@jakarta.apache.org
        ReportedBy: greggarson@hotmail.com


I'm getting the #VALUE! result in a spreadsheet from the following code:

HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.createSheet("New Sheet");
HSSFRow row = sheet.createRow((short)0);
HSSFCell cell1 = row.createCell((short)0);
cell1.setCellValue(1);
HSSFCell cell2 = row.createCell((short)1);
cell2.setCellValue(2);
HSSFCell cell3 = row.createCell((short)2);
cell3.setCellValue(3);
SheetReferences sRef = new SheetReferences();
sRef.addSheetReference("First Sheet", 0);
HSSFCell cell4 = row.createCell((short)3);
cell4.setCellType(HSSFCell.CELL_TYPE_FORMULA);
Ptg[] ref = new Ptg[5];
ref[0] = new AreaPtg("A1:B1");
ref[1] = new IntPtg("1");
ref[2] = new FuncVarPtg("LARGE", (byte)2);
ref[3] = new ReferencePtg("C1");
ref[4] = new AddPtg();
cell4.setCellFormula(FormulaParser.toFormulaString(sRef, ref));
FileOutputStream fileOut = new FileOutputStream("testWorkBook1.xls");
wb.write(fileOut);
fileOut.close();

Have also tried entering this straight into setCellFormula as "LARGE(A1:B1,1)
+C1" returning the same effect.  Is LARGE an unsupported 'array formula' as 
specified under formula support?

Mime
View raw message