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 2009/03/31 16:05:09 UTC

DO NOT REPLY [Bug 46944] New: Error Value can only be 0,7,15,23,29,36 or 42. It cannot be -30

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

           Summary: Error Value can only be 0,7,15,23,29,36 or 42. It
                    cannot be -30
           Product: POI
           Version: 3.2-FINAL
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HSSF
        AssignedTo: dev@poi.apache.org
        ReportedBy: criverapr@gmail.com


I get the following exception when trying to refresh all formulas on an excel
sheet.  I've attached an excel sheet and a java file that produce the error.


java.lang.RuntimeException: Error Value can only be 0,7,15,23,29,36 or 42. It
cannot be -30
    at
org.apache.poi.hssf.record.BoolErrRecord.setValue(BoolErrRecord.java:101)
    at
org.apache.poi.hssf.usermodel.HSSFCell.setCellErrorValue(HSSFCell.java:750)
    at
org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator.setCellValue(HSSFFormulaEvaluator.java:222)
    at
org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator.evaluateInCell(HSSFFormulaEvaluator.java:194)
    at
com.tech_innovapr.poi.examples.UpdateFormulas.refreshWorkbookFormulas(UpdateFormulas.java:67)
    at
com.tech_innovapr.poi.examples.UpdateFormulas.main(UpdateFormulas.java:25)

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


DO NOT REPLY [Bug 46944] Error Value can only be 0,7,15,23,29,36 or 42. It cannot be -30

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





--- Comment #1 from criverapr@gmail.com  2009-03-31 07:06:02 PST ---
Created an attachment (id=23431)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=23431)
Excel and Java file to reproduce error

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


DO NOT REPLY [Bug 46944] Error Value can only be 0,7,15,23,29,36 or 42. It cannot be -30

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





--- Comment #2 from criverapr@gmail.com  2009-03-31 13:23:04 PST ---
(In reply to comment #0)
> I get the following exception when trying to refresh all formulas on an excel
> sheet.  I've attached an excel sheet and a java file that produce the error.
> 
> 
> java.lang.RuntimeException: Error Value can only be 0,7,15,23,29,36 or 42. It
> cannot be -30
>     at
> org.apache.poi.hssf.record.BoolErrRecord.setValue(BoolErrRecord.java:101)
>     at
> org.apache.poi.hssf.usermodel.HSSFCell.setCellErrorValue(HSSFCell.java:750)
>     at
> org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator.setCellValue(HSSFFormulaEvaluator.java:222)
>     at
> org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator.evaluateInCell(HSSFFormulaEvaluator.java:194)
>     at
> com.tech_innovapr.poi.examples.UpdateFormulas.refreshWorkbookFormulas(UpdateFormulas.java:67)
>     at
> com.tech_innovapr.poi.examples.UpdateFormulas.main(UpdateFormulas.java:25)

Ok I found that this doesn't happen when I use the
FormulaEvaluator.evaluateFormulaCell which should be the method used for
refreshing the sheet formulas instead of the one I was
using(FormulaEvaluator.evaluateInCell).  But I think the above error should be
checked out anyways.

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


DO NOT REPLY [Bug 46944] Error Value can only be 0,7,15,23,29,36 or 42. It cannot be -30

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


Josh Micich <jo...@gildedtree.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |LATER




--- Comment #3 from Josh Micich <jo...@gildedtree.com>  2009-04-01 13:37:41 PST ---
The -30 code is caused by POI attempting to evaluate a function which has not
been implemented.  Part of the problem is that the -30 error value can silently
propagate around, masquerading as a genuine Excel error code. So using
FormulaEvaluator.evaluateInCell() has probably not avoided the real problem.
Since bug 46580 , POI has been improved to throw an exception explaining which
function needs to be implemented.  

In the file you have uploaded, there are actually two functions that POI does
not support yet: ADDRESS() and INDIRECT().  The implementation of ADDRESS()
should be relatively straightforward. INDIRECT()  might be more complex because
it involves invoking a formula parser on an arbitrary string value, during
evaluation (something that hasn't been done in POI yet).

Since you are using a combination of INDIRECT(ADDRESS(...)) it might be
possible to replace this with OFFSET() (which POI *can* evaluate).

I am marking this bug as 'LATER' in the hope that OFFSET() might do what you
need. Please change the status if you can't find an acceptable work around.  As
always, we are happy to receive patches from new contributors.

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