poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shinya Koizumi" <shi...@smartestdesign.com>
Subject Re: Formula trouble -- URGENT Pls help
Date Mon, 15 May 2006 21:02:08 GMT
I am not familiar with POI, but can explicitly set the
saved flag to true before closing the document?

The Micorosft Office object gives me an option to change the status of
current
document/sheet. However, I am not sure if this is opened to poi.

I think MS Excel is looking at this flag to see if any modification occurs
for the current sheet and pops up the save dialog.

Hope it helps.

Shinya

----- Original Message -----
From: "Nidhi Tuli" <ntuli@paymentone.com>
To: <poi-user@jakarta.apache.org>
Sent: Monday, May 15, 2006 1:10 PM
Subject: Formula trouble -- URGENT Pls help


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




---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


Mime
View raw message