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 46537] New: Cannot get cell formula.
Date Thu, 15 Jan 2009 08:42:04 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=46537

           Summary: Cannot get cell formula.
           Product: POI
           Version: 3.5-dev
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSSF
        AssignedTo: dev@poi.apache.org
        ReportedBy: matthew.knl@gmail.com


I run following codes cannot get the cell formula from attached excel file.

Sheet sheet = wb.getSheet("Test");
for(int i=1; i <= sheet.getLastRowNum(); i++)
{
        Row row = sheet.getRow(i);
        Cell cell = row.getCell(2);
        String formula = cell.getCellFormula();
        System.("formula: " + formula);
}

--
It throws "Not implemented yet" exception, I know it means POI project team is
working on it. But the formula of first row of the formula cells can be
retrieved, is it possible I can get the other cell formula as well? I don't
need to evaluate the formula, just the formula string is enough.


java.lang.RuntimeException: Not implemented yet
        at
org.apache.poi.xssf.usermodel.XSSFEvaluationWorkbook.getNameXPtg(XSSFEvaluationWorkbook.java:92)
        at
org.apache.poi.ss.formula.FormulaParser.function(FormulaParser.java:541)
        at
org.apache.poi.ss.formula.FormulaParser.parseFunctionReferenceOrName(FormulaParser.java:323)
        at
org.apache.poi.ss.formula.FormulaParser.parseSimpleFactor(FormulaParser.java:724)
        at
org.apache.poi.ss.formula.FormulaParser.percentFactor(FormulaParser.java:684)
        at
org.apache.poi.ss.formula.FormulaParser.powerFactor(FormulaParser.java:671)
        at org.apache.poi.ss.formula.FormulaParser.Term(FormulaParser.java:973)
        at
org.apache.poi.ss.formula.FormulaParser.additiveExpression(FormulaParser.java:1074)
        at
org.apache.poi.ss.formula.FormulaParser.concatExpression(FormulaParser.java:1058)
        at
org.apache.poi.ss.formula.FormulaParser.comparisonExpression(FormulaParser.java:1015)
        at
org.apache.poi.ss.formula.FormulaParser.unionExpression(FormulaParser.java:994)
        at
org.apache.poi.ss.formula.FormulaParser.parse(FormulaParser.java:1116)
        at
org.apache.poi.ss.formula.FormulaParser.parse(FormulaParser.java:191)
        at
org.apache.poi.xssf.usermodel.XSSFCell.convertSharedFormula(XSSFCell.java:352)
        at
org.apache.poi.xssf.usermodel.XSSFCell.getCellFormula(XSSFCell.java:332)
        at com.dttn.excel.connector.TestPOI.printCellFormula(TestPOI.java:96)
        at com.dttn.excel.connector.TestPOI.main(TestPOI.java:71)

--

Thanks!


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