|
View:
New views
7 Messages
—
Rating Filter:
Alert me
|
|
|
Cell Formula not refreshedI use HSSF POI to update a spreadsheet with data taken from a database. I have a totals row that takes the sum of a range of cells as seen in the image below:
TOTALS ROWWhen i open the file after it has been populated with the information using OpenOffice the totals row has the correct values in it. However, when i open the file using MS Excel the value in the cell is #VALUE! and not the nurmeric value it should be. I am using POI 3.1 and the code i use to recalculate the values is: for(int sheetNum = 0; sheetNum < wb.getNumberOfSheets(); sheetNum++) { HSSFSheet sheet = wb.getSheetAt(sheetNum); HSSFFormulaEvaluator evaluator = new HSSFFormulaEvaluator(sheet, wb); for(Iterator<?> rit = sheet.rowIterator(); rit.hasNext();) { HSSFRow r = (HSSFRow)rit.next(); evaluator.setCurrentRow(r); for(Iterator<?> cit = r.cellIterator(); cit.hasNext();) { HSSFCell c = (HSSFCell)cit.next(); if(c.getCellType() == HSSFCell.CELL_TYPE_FORMULA) { evaluator.evaluateFormulaCell(c); } } } Anyone got any suggestions to what is happen? many thanks mark |
|
|
Re: Cell Formula not refreshedOn Mon, 14 Jul 2008, mjw_85uk wrote:
> When i open the file after it has been populated with the information > using OpenOffice the totals row has the correct values in it. However, > when i open the file using MS Excel the value in the cell is #VALUE! and > not the nurmeric value it should be. I am using POI 3.1 and the code i > use to recalculate the values is: It might be worth trying a recent nightly build [1], there have been a few formula evaluation fixes since 3.1 final Nick [1] http://encore.torchbox.com/poi-svn-build/ --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@... For additional commands, e-mail: user-help@... |
|
|
Re: Cell Formula not refreshedhi nick,
thanks for the advice. i updated the jar file to a build jar file from last night and it worked prefectly. many thanks mark
|
|
|
FormulaParser$FormulaParseExce |
|
|
Re: FormulaParser$FormulaParseExce |
|
|
Re: FormulaParser$FormulaParseExce |
|
|
Re: FormulaParser$FormulaParseExce |
| Free Forum Powered by Nabble | Forum Help |