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 50096] New: Wrong cell value in XSSF when evaluating formula in a cell with index > 255
Date Fri, 15 Oct 2010 06:49:07 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=50096

           Summary: Wrong cell value in XSSF when evaluating formula in a
                    cell with index > 255
           Product: POI
           Version: 3.7-dev
          Platform: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSSF
        AssignedTo: dev@poi.apache.org
        ReportedBy: martin.studer@mirai-solutions.com


Cells in a row with an index > 255 that contain formulas may be evaluated
wrongly.

The specific case can be seen in the attached Excel file (repro.xlsx). There
are two rows. The first row simply contains the numbers 1 - 300. The second row
simply refers to the cell value above in the first row by a simple formula.

When evaluating the cell values (using the FormulaEvaluator) you get wrong cell
values for cells in the second row if they have an index > 255.

The following code demonstrates the problem:

Workbook wb = WorkbookFactory.create(new FileInputStream("repro.xlsx"));
        FormulaEvaluator evaluator =
wb.getCreationHelper().createFormulaEvaluator();

        for(int i = 245; i < 265; i++) {
            Cell cell_noformula = wb.getSheetAt(0).getRow(0).getCell(i);
            Cell cell_formula = wb.getSheetAt(0).getRow(1).getCell(i);

            CellValue cv_noformula = evaluator.evaluate(cell_noformula);
            CellValue cv_formula = evaluator.evaluate(cell_formula);
            System.out.println("Cell " + i + ": no formula = " +
cv_noformula.getNumberValue() + ", formula = " + cv_formula.getNumberValue());
        }


OS: Windows 7
POI: 3.7-beta3
Java: 1.6.0_20 64-bit

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message