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 2008/05/14 17:36:10 UTC
DO NOT REPLY [Bug 44997] New: Cell Range in Formula not being
Evaluated in Excel
https://issues.apache.org/bugzilla/show_bug.cgi?id=44997
Summary: Cell Range in Formula not being Evaluated in Excel
Product: POI
Version: unspecified
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: major
Priority: P2
Component: HSSF
AssignedTo: dev@poi.apache.org
ReportedBy: jrhodes@jernberg.com
Placing a cell range in a formula results in a #VALUE! in the excel sheet if
the range rows differ. For example,
"SUM(G22:G22)" evaluates properly by summing the contents of cell G22
"SUM(G22:G28)" results in a #VALUE! in the excel document.
This functionality worked fine as of poi-bin-3.0.1-FINAL-20070705, but does not
work in poi-3.1-beta1.
A sample code snippet that sets the formula contents can be found below:
HSSFCellStyle summaryDataStyle = wb.createCellStyle();
summaryDataStyle.setAlignment(HSSFCellStyle.ALIGN_RIGHT);
summaryDataStyle.setFont(summaryItemFont);
summaryDataStyle.setDataFormat((short) 3);
...
HSSFCell currentCell = row.createCell((short)columnIndex++);
currentCell.setCellStyle(summaryDataStyle);
currentCell.setCellType(HSSFCell.CELL_TYPE_FORMULA);
currentCell.setCellFormula("SUM(G"+(previousItemStartRow+1)+":G"+row.getRowNum()+")");
where previousItemStartRow is an int.
Very strange that it evaluates correctly for a range that resolves to a single
cell, but not for a real range of cells. Again, the EXACT same code works fine
under the above 3.0 release.
--
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 44997] Cell Range in Formula not being Evaluated
in Excel
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44997
Josh Micich <jo...@gildedtree.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
--- Comment #2 from Josh Micich <jo...@gildedtree.com> 2008-05-14 10:26:56 PST ---
Reproduced in 3.1-beta1
This problem was resolved in the follow-up fix for bug 44675 (svn r652994).
You can either use the latest svn trunk or wait for final 3.1 to get this fix.
--
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 44997] Cell Range in Formula not being Evaluated
in Excel
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44997
--- Comment #1 from Jeff Rhodes <jr...@jernberg.com> 2008-05-14 09:00:41 PST ---
Note that SUM(G7,G8) Works fine as well
--
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