poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nidhi Tuli" <nt...@paymentone.com>
Subject Formula trouble -- URGENT Pls help
Date Mon, 15 May 2006 20:10:43 GMT
I am generating an excel sheet for reporting purposes. In this Excel
some of the cells will contain formulas and their value should depend on
the formulas.
I successfully generated cells with formula and their values were
correct when I opened excel for viewing.  My trouble starts here. When I
open excel sheet it shows me correct values but when I try to close it ,
Excel prompts me to save the file. This is not acceptable according to
our requirements. So is there a way to get ride of this message and
still keep the formulas in my excel sheet cells?
 
Looking at this problem I am trying different approaches. I tried
 
HSSFFormulaEvaluator evaluator = new HSSFFormulaEvaluator(sheet, wb);
evaluator.setCurrentRow(row);
evaluator.evaluateInCell(cell)
 
thinking that it will evaluate the value of the formula before opening
and the file won't be dirty when it is open.
The above code started giving me RuntimeException. So I had to introduce
some changes
 
HSSFFormulaEvaluator evaluator = new HSSFFormulaEvaluator(sheet, wb);
evaluator.setCurrentRow(row);
cell.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
evaluator.evaluateInCell(cell)
 
 
But this change will overwrite the formula and my cells only are numeric
static cells.
 
Is there a way to get ride of "save" message and still keep the formulas
in my excel sheet cells?
 
Any pointer or help is greatly appreciated.
 
Thanks
Nidhi
 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message