You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by Avik Sengupta <av...@itellix.com> on 2005/06/10 16:31:48 UTC

RE: FormulaRecord getValue &setVal ue enhancement

Sounds good!

AFAIK, getValue for numbers and strings should already work in HSSFCell,
no? there is, of course, no implementation for setting. 

getValueType -- is there enuf logic to know this for sure?

Also, if you are doing this, you may as well update the HSSFCell
methods ... pretty please! :)

On Thu, 2005-06-09 at 17:17 -0400, Amol Deshmukh wrote:
> Ok.. thanks for the info! I didnt realise that
> FormulaRecordAggregate stored the string value
> of the formula evaluation.
> 
> I dont think the PATCH for 35290 will have any 
> adverse effects on the StringRecord. But looks 
> like there needs to be a setValue(..) in the
> FormulaRecordAggregate that will set the correct 
> value in a StringRecord if the calculated value 
> is String.
> 
> So here's what I've done locally in addition to the
> changes in current PATCH:
> 
> In FormulaRecordAggregate.java
> 1. add setValue(..) overloaded for double, String
>    , errorCode, blank value types
> 2. add getNumberValue(), getBooleanValue()
>    , getErrorCodeValue()
> 3. add getValueType()
> 
> I plan on doing testing with actual excel files
> as well to ensure deserializing and serializing 
> both work fine after the change.
> 
> If that seems fine to you, I will update the 
> PATCH file for 35290.
> 
> Regards,
> ~ amol
> 
> 
> 
> 
> 
> > -----Original Message-----
> > From: avik.sengupta@itellix.com [mailto:avik.sengupta@itellix.com]
> > Sent: Thursday, June 09, 2005 2:19 PM
> > To: Amol Deshmukh
> > Subject: Re: FormulaRecord getValue &setVal ue enhancement
> > 
> > 
> > String formula results are stored as a String record that 
> > follows a formula
> > record. POI handles them together as FormulaRecordAggregate. 
> > Can you ensure
> > your patch does not mess this up? Thanks.
> > 
> > Quoting Amol Deshmukh <ad...@hobsons-us.com>:
> > 
> > >
> > > I started of trying to implement fix for 35288 but=20
> > > realised that FormulaRecord assumes and stores only
> > > double value as the result of the formula.
> > >
> > > I checked OO documentation=20
> > > (pg 163 of http://sc.openoffice.org/excelfileformat.pdf)=20
> > > and it has description of how excel stores different
> > > value types for a formula result.
> > >
> > > So the patch attempts to do just that...
> > >
> > >
> > > ... but I assumed that for string formulas, the
> > > value is not stored since the value bytes are
> > > fixed length (8 bytes) so cannot hold a String
> > > of arbitrary length.
> > >
> > > Now, FormulaRecord can accept and serialize=20
> > > values for formula of types other than double,
> > > this will enable a fix for 35288 (since instead
> > > of casting to specific Record, we hace option=20
> > > of casting to FormulaRecord too since now it
> > > can accept different data types in the setvalue)
> > >
> > > (hope I made some sense :)
> > >
> > > ~ amol
> > >
> > >
> > >
> > >
> > >> -----Original Message-----
> > >> From: avik.sengupta@itellix.com [mailto:avik.sengupta@itellix.com]
> > >> Sent: Thursday, June 09, 2005 1:39 PM
> > >> To: poi-dev@jakarta.apache.org
> > >> Subject: Re: DO NOT REPLY [Bug 35290] - FormulaRecord=20
> > >> getValue &setValue
> > >> enhancement
> > >> =20
> > >> =20
> > >> Amol,
> > >> =20
> > >> Can you please talk us thru this patch.. I am not clear what=20
> > >> it does. In
> > >> particular, I am not sure how this interacts with=20
> > >> StringRecord. Also does this
> > >> help with your other bug (35288)
> > >> =20
> > >> Thanks for the patch.
> > >> =20
> > >> Regards
> > >> -
> > >> Avik
> > >> =20
> > >> =20
> > >> Quoting bugzilla@apache.org:
> > >> =20
> > >> > DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG=B7
> > >> > RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
> > >> > <http://issues.apache.org/bugzilla/show_bug.cgi?id=3D35290>.
> > >> > ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND=B7
> > >> > INSERTED IN THE BUG DATABASE.
> > >> >
> > >> > http://issues.apache.org/bugzilla/show_bug.cgi?id=3D35290
> > >> >
> > >> >
> > >> >
> > >> >
> > >> >
> > >> > ------- Additional Comments From amolweb@yahoo.com=20=20
> > >> 2005-06-09 18:37 -------
> > >> > Created an attachment (id=3D15355)
> > >> >  -->=20
> > >> (http://issues.apache.org/bugzilla/attachment.cgi?id=3D15355&act
> > >> ion=3Dview)
> > >> > [PATCH] Enhancements to FormulaRecord for reading=20
> > >> calculated value of formula
> > >> >
> > >> > Prior to this Patch, FormulaRecord ignored non numeric values=20
> > >> > (treated them as
> > >> > UNKNOWN). This patch modifies FormulaRecord so that it 
> > correctly=20
> > >> > identifies the
> > >> > type of the value and stores it. Testcases have been=20
> > >> included in patch.
> > >> >
> > >> > Results were verified by running BiffView (since=20
> > >> FormulaRecord.toString() has
> > >> > also been modified accordingly).
> > >> >
> > >> > --
> > >> > Configure bugmail:=20
> > > http://issues.apache.org/bugzilla/userprefs.cgi?tab=3Demail
> > >> ------- You are receiving this mail because: -------
> > >> You are the assignee for the bug, or are watching the assignee.
> > >>
> > >> 
> > ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: poi-dev-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-dev-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-dev-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-dev-unsubscribe@jakarta.apache.org
Mailing List:    http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/