[prev in list] [next in list] [prev in thread] [next in thread] 

List:       poi-user
Subject:    Re: Formula trouble -- URGENT Pls help
From:       "Shinya Koizumi" <shinya () smartestdesign ! com>
Date:       2006-05-15 23:02:43
Message-ID: 002401c67873$accc9a60$c401a8c0 () nagoya
[Download RAW message or body]

I think the problem is not POI, but MS Excel works like this.

Try to create a excel sheet with a cell containing a formula
=Now() and save it locally. Next time you open and close the
excel sheet, the save dialog will pop up.


Shinya

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


> 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:shinya@smartestdesign.com] 
> 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" <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/
> 
> 
> ---------------------------------------------------------------------
> 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/
> 
> 


---------------------------------------------------------------------
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/

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic