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 2013/07/02 17:18:21 UTC

[Bug 55185] New: ISNUMBER function doesn't work in if statement

https://issues.apache.org/bugzilla/show_bug.cgi?id=55185

            Bug ID: 55185
           Summary: ISNUMBER function doesn't work in if statement
           Product: POI
           Version: 3.9
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HSSF
          Assignee: dev@poi.apache.org
          Reporter: srousseau@sodifrance.fr

With POI 3.9, I'm faces the same problem as reported in bug id #27405

Here is the code :
        HSSFWorkbook book = new HSSFWorkbook();
        HSSFSheet sheet2 = book.createSheet("ma feuille");

        HSSFRow row = sheet2.createRow(0);
        HSSFCell cell = null;

        cell = row.createCell(0);
        cell.setCellValue(10);

        cell = row.createCell(1);
        cell.setCellValue(20);

        cell = row.createCell(2);
        cell.setCellValue(30);

        cell = row.createCell(3);
        cell.setCellType(HSSFCell.CELL_TYPE_FORMULA);
       
cell.setCellFormula("IF(AND(ISNUMBER(A1),ISNUMBER(B1)),(A1*B1)/(1000),\"toto\")");

Where I open the workbook, I see "toto" in cell. Then I just click in the
formula for cell A3 and enter. Then it works

Stephane

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


[Bug 55185] ISNUMBER function doesn't work in if statement

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55185

--- Comment #3 from srousseau@sodifrance.fr ---
(In reply to srousseau from comment #2)
> (In reply to Nick Burch from comment #1)
> > After changing a formula, you must trigger a recalculation to ensure the
> > cached value is correctly stored/set in the file
> > 
> > See http://poi.apache.org/spreadsheet/eval.html for instructions on how to
> > do this
> 
> Great!!
>  It works with HSSFFormulaEvaluator.evaluateAllFormulaCells(myWorkBook).
> 
> I upgrade from POI 3.0 to POI 3.9 and I didn't need to call this code. So I
> didn't know about "Formula Evaluation".
> 
> Thanks a lot !
> 
> Stephane

Hello,

I dont't know what I've changed since last Tuesday but I doesn't work anymore.
I now see "toto" as result.
I'm using HSSFFormulaEvaluator.evaluateAllFormulaCells(book.getWorkbook()); and
book.getWorkbook().setForceFormulaRecalculation(true); but the cell value is
not refreshed. But I can see the call to evaluateFormulaCell for each formula
cell.

In excel, I have to click in the cell to refresh the cell value as in the
beginning.

I run Excel 2010 with HSSFWorkbook.

So, if anybody has idea ...

Regards

Stéphane Rousseau

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


[Bug 55185] ISNUMBER function doesn't work in if statement

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55185

--- Comment #2 from srousseau@sodifrance.fr ---
(In reply to Nick Burch from comment #1)
> After changing a formula, you must trigger a recalculation to ensure the
> cached value is correctly stored/set in the file
> 
> See http://poi.apache.org/spreadsheet/eval.html for instructions on how to
> do this

Great!!
 It works with HSSFFormulaEvaluator.evaluateAllFormulaCells(myWorkBook).

I upgrade from POI 3.0 to POI 3.9 and I didn't need to call this code. So I
didn't know about "Formula Evaluation".

Thanks a lot !

Stephane

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


[Bug 55185] ISNUMBER function doesn't work in if statement

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55185

Nick Burch <ap...@gagravarr.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID
                 OS|                            |All

--- Comment #1 from Nick Burch <ap...@gagravarr.org> ---
After changing a formula, you must trigger a recalculation to ensure the cached
value is correctly stored/set in the file

See http://poi.apache.org/spreadsheet/eval.html for instructions on how to do
this

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