I think the problem with POI is that in formula fields it just assigns
the formula and let Excel evaluates the value when file is opened. So
when ever
We open file, it recalculates the values that makes the generated file
unsaved. 

I need to way to actually assign the formula and the calculated values
when I am coding using POI. Calculated value will be in compliance with
the formula. And formula will be useful latter if somebody wants to
change excel file.

/Nidhi

-----Original Message-----
From: Shinya Koizumi [mailto:[EMAIL PROTECTED] 
Sent: Monday, May 15, 2006 2:02 PM
To: POI Users List
Subject: Re: Formula trouble -- URGENT Pls help

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" <[EMAIL PROTECTED]>
To: <[email protected]>
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: [EMAIL PROTECTED]
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


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

Reply via email to