You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Karl-Heinz Zengerle <ka...@sawag.com> on 2004/07/02 18:52:31 UTC

Re: invalid formula

Hi world.

Are any Excel formulas (with valid function names) known which can't be
evaluated in POI? The answer is urgent.

If the general answer isn't known then a statement about the lookup
functions (like SVERWEIS in German) would be welcome.

Regards, Karl-Heinz.


Am Mo 28.06.2004 15:21 schrieb Karl-Heinz Zengerle
<ka...@sawag.com>:

> Hi world.
> 
> How are invalid formula detected, e.g. a function NONSENSE() not
> existing in Excel? How will the application see that?
> 
> As Excel documents can also be created in OpenOffice e.g. the Bessel
> functions aren't available in Excel. Such files could be processed in
> POI. So such situations could occur in practice.
> 
> Regards, Karl-Heinz.



---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org


Re: invalid formula

Posted by Karl-Heinz Zengerle <ka...@sawag.com>.
Thanks Avik.

I.e. I never see actualized formula result value in POI without having
opened the file with Excel first.

Regards, Karl-Heinz.


Am Di 06.07.2004 12:22 schrieb Avik Sengupta
<av...@itellix.com>:

> Poi does NOT evalauate formula's. getXXValue() calls return the saved
> formula result, as caculated by Excel. For new formulas entered via
> POI,
> getNumericValue always returns 0.
>  
> On Tue, 2004-07-06 at 15:24, Karl-Heinz Zengerle wrote:
> > Hi Avik.
> > 
> > Are you also able to evaluate all mapped formula (when a user calls
> > the
> > getStringValue() or getNumericValue() method of a cell) within POI?
> > 
> > E.g. there are functions like SVERWEIS() where internally quite a
> > lot
> > has to be done.
> > 
> > Regards, Karl-Heinz.
> > 
> > 
> > Am Di 06.07.2004 10:03 schrieb Avik Sengupta
> > <av...@itellix.com>:
> > 
> > > Excel stores an integer index for the inbuilt functions. POI knows
> > > the
> > > mappings between the ENGLISH function names and the indices. I
> > > think
> > > we
> > > have all the names upto office xp, but check in code to be sure.
> > > AbstractFunctionPtg.java
> > > 
> > > For names that are not recognised, POI will put in the integer for
> > > an
> > > user defined function. If that UDF is not defined in the excel
> > > template,
> > > Excel will show #NAME on opening the file. 
> > > 
> > > Regards
> > > -
> > > Avik
> > > 
> > > 
> > > PS. you had said urgent, sorry for the delay. 
> > > 
> > > On Fri, 2004-07-02 at 22:22, Karl-Heinz Zengerle wrote:
> > > > Hi world.
> > > > 
> > > > Are any Excel formulas (with valid function names) known which
> > > > can't
> > > > be
> > > > evaluated in POI? The answer is urgent.
> > > > 
> > > > If the general answer isn't known then a statement about the
> > > > lookup
> > > > functions (like SVERWEIS in German) would be welcome.
> > > > 
> > > > Regards, Karl-Heinz.
> > > > 
> > > > 
> > > > Am Mo 28.06.2004 15:21 schrieb Karl-Heinz Zengerle
> > > > <ka...@sawag.com>:
> > > > 
> > > > > Hi world.
> > > > > 
> > > > > How are invalid formula detected, e.g. a function NONSENSE()
> > > > > not
> > > > > existing in Excel? How will the application see that?
> > > > > 
> > > > > As Excel documents can also be created in OpenOffice e.g. the
> > > > > Bessel
> > > > > functions aren't available in Excel. Such files could be
> > > > > processed
> > > > > in
> > > > > POI. So such situations could occur in practice.
> > > > > 
> > > > > Regards, Karl-Heinz.
> > > > 
> > > > 
> > > > 
> > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> > > > For additional commands, e-mail:
> > > > poi-user-help@jakarta.apache.org
> > > > 
> > > 
> > > 
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: poi-user-help@jakarta.apache.org
> > > 
> > > 
> > 
> > 
> > 
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: poi-user-help@jakarta.apache.org
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-user-help@jakarta.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org


Re: invalid formula

Posted by Avik Sengupta <av...@itellix.com>.
Poi does NOT evalauate formula's. getXXValue() calls return the saved
formula result, as caculated by Excel. For new formulas entered via POI,
getNumericValue always returns 0.
 
On Tue, 2004-07-06 at 15:24, Karl-Heinz Zengerle wrote:
> Hi Avik.
> 
> Are you also able to evaluate all mapped formula (when a user calls the
> getStringValue() or getNumericValue() method of a cell) within POI?
> 
> E.g. there are functions like SVERWEIS() where internally quite a lot
> has to be done.
> 
> Regards, Karl-Heinz.
> 
> 
> Am Di 06.07.2004 10:03 schrieb Avik Sengupta
> <av...@itellix.com>:
> 
> > Excel stores an integer index for the inbuilt functions. POI knows the
> > mappings between the ENGLISH function names and the indices. I think
> > we
> > have all the names upto office xp, but check in code to be sure.
> > AbstractFunctionPtg.java
> > 
> > For names that are not recognised, POI will put in the integer for an
> > user defined function. If that UDF is not defined in the excel
> > template,
> > Excel will show #NAME on opening the file. 
> > 
> > Regards
> > -
> > Avik
> > 
> > 
> > PS. you had said urgent, sorry for the delay. 
> > 
> > On Fri, 2004-07-02 at 22:22, Karl-Heinz Zengerle wrote:
> > > Hi world.
> > > 
> > > Are any Excel formulas (with valid function names) known which can't
> > > be
> > > evaluated in POI? The answer is urgent.
> > > 
> > > If the general answer isn't known then a statement about the lookup
> > > functions (like SVERWEIS in German) would be welcome.
> > > 
> > > Regards, Karl-Heinz.
> > > 
> > > 
> > > Am Mo 28.06.2004 15:21 schrieb Karl-Heinz Zengerle
> > > <ka...@sawag.com>:
> > > 
> > > > Hi world.
> > > > 
> > > > How are invalid formula detected, e.g. a function NONSENSE() not
> > > > existing in Excel? How will the application see that?
> > > > 
> > > > As Excel documents can also be created in OpenOffice e.g. the
> > > > Bessel
> > > > functions aren't available in Excel. Such files could be processed
> > > > in
> > > > POI. So such situations could occur in practice.
> > > > 
> > > > Regards, Karl-Heinz.
> > > 
> > > 
> > > 
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: poi-user-help@jakarta.apache.org
> > > 
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: poi-user-help@jakarta.apache.org
> > 
> > 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org


Re: AW: AW: formula return type

Posted by Avik Sengupta <av...@itellix.com>.
Looking at the code, I think there are some bugs in getBooleanValue in
HSSFCell. It doesn't handle formulas. Also, with getStringValue, i'm not
sure you can differentiate between actual empty result, or "bad type". 

Essentially this looks like a hack, primarily becoz it depends on
functionality that cant be guaranteed to work after any bugfix submitted
by any contributor. If you want this functionality, you'll have to write
a more foolproof way into HSSFCell, and submit it in. Otherwise, you may
be able to implement this in your code, but it'll be very brittle. Just
my 2c.. not gospel :)

Regards
-
Avik


On Mon, 2004-07-19 at 20:52, Davinder Kohli wrote:
> I tried your approach, reading it as
> string(getStringCellValue) first. "" was returned. 
> When I read it as numeric, NaN is returned.
> 
> The formula stored is AND(A1,B1).
> Regards
> 
> --- "KHZ (SAW)" <ka...@sawag.com> wrote:
> > Hi Davinder.
> > 
> > Try it with first fetching the string value and
> > checking for 0. I think
> > the fetching the numeric value returns 0 and not
> > NaN.
> > 
> > I'ld expect that booleans are 0/1.
> > 
> > Regards,	Karl-Heinz.
> > 
> > 
> > -----Ursprüngliche Nachricht-----
> > Von: Davinder Kohli [mailto:kdavinder@yahoo.com] 
> > Gesendet: Montag, 19. Juli 2004 16:28
> > An: POI Users List
> > Betreff: Re: AW: formula return type
> > 
> > Thank you Karl.
> > That's exactly what I am doing. I wanted to go a
> > step
> > further and read in the contents of a cell
> > containing
> > a logical formula.
> > 1. When reading it as a string I get "", it would be
> > nice if I could read it as getBooleanCellValue().
> > 
> > 2. I also wanted to determine if the cell
> > (containing
> > a formula which returns numeric value) is of type
> > date.
> > 
> > double cellValue = theCell.getNumericCellValue();
> > if (Double.isNaN(cellValue)){
> >   // string value
> >   String strCell = theCell.getStringCellValue();
> > } else {
> >   // numeric
> >   ....
> > }
> > 
> > 
> > --- "KHZ (SAW)" <ka...@sawag.com>
> > wrote:
> > > Hi Davinder.
> > > 
> > > Actually you can query it as a numeric or a string
> > > value. If you've
> > > chosen the wrong type the result is "" or 0.
> > > Unfortunately you don't see
> > > the type. You just can look for the most
> > reasonable
> > > result.
> > > 
> > > Regards,	Karl-Heinz.
> > > 
> > > 
> > > -----Ursprüngliche Nachricht-----
> > > Von: Davinder Kohli [mailto:kdavinder@yahoo.com] 
> > > Gesendet: Freitag, 16. Juli 2004 22:36
> > > An: POI Users List
> > > Betreff: formula return type
> > > 
> > > Hi,
> > > How do I determine the return type of a formula?
> > Is
> > > there an API provided to do this or do I need to
> > > checkout the formula and then determine its return
> > > type.
> > > 
> > > Thanks,
> > > Davinder
> > > 
> > > 
> > > 		
> > > __________________________________
> > > Do you Yahoo!?
> > > Yahoo! Mail - 50x more storage than other
> > providers!
> > > http://promotions.yahoo.com/new_mail
> > > 
> > >
> >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > > poi-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail:
> > > poi-user-help@jakarta.apache.org
> > > 
> > > 
> > > 
> > > 
> > >
> >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > > poi-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail:
> > > poi-user-help@jakarta.apache.org
> > > 
> > > 
> > 
> > 
> > 
> > 		
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Mail - 50x more storage than other providers!
> > http://promotions.yahoo.com/new_mail
> > 
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > poi-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> > poi-user-help@jakarta.apache.org
> > 
> > 
> > 
> > 
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > poi-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> > poi-user-help@jakarta.apache.org
> > 
> > 
> 
> 
> 
> 		
> __________________________________
> Do you Yahoo!?
> Vote for the stars of Yahoo!'s next ad campaign!
> http://advision.webevents.yahoo.com/yahoo/votelifeengine/
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org


Re: AW: AW: formula return type

Posted by Davinder Kohli <kd...@yahoo.com>.
I tried your approach, reading it as
string(getStringCellValue) first. "" was returned. 
When I read it as numeric, NaN is returned.

The formula stored is AND(A1,B1).
Regards

--- "KHZ (SAW)" <ka...@sawag.com> wrote:
> Hi Davinder.
> 
> Try it with first fetching the string value and
> checking for 0. I think
> the fetching the numeric value returns 0 and not
> NaN.
> 
> I'ld expect that booleans are 0/1.
> 
> Regards,	Karl-Heinz.
> 
> 
> -----Urspr�ngliche Nachricht-----
> Von: Davinder Kohli [mailto:kdavinder@yahoo.com] 
> Gesendet: Montag, 19. Juli 2004 16:28
> An: POI Users List
> Betreff: Re: AW: formula return type
> 
> Thank you Karl.
> That's exactly what I am doing. I wanted to go a
> step
> further and read in the contents of a cell
> containing
> a logical formula.
> 1. When reading it as a string I get "", it would be
> nice if I could read it as getBooleanCellValue().
> 
> 2. I also wanted to determine if the cell
> (containing
> a formula which returns numeric value) is of type
> date.
> 
> double cellValue = theCell.getNumericCellValue();
> if (Double.isNaN(cellValue)){
>   // string value
>   String strCell = theCell.getStringCellValue();
> } else {
>   // numeric
>   ....
> }
> 
> 
> --- "KHZ (SAW)" <ka...@sawag.com>
> wrote:
> > Hi Davinder.
> > 
> > Actually you can query it as a numeric or a string
> > value. If you've
> > chosen the wrong type the result is "" or 0.
> > Unfortunately you don't see
> > the type. You just can look for the most
> reasonable
> > result.
> > 
> > Regards,	Karl-Heinz.
> > 
> > 
> > -----Urspr�ngliche Nachricht-----
> > Von: Davinder Kohli [mailto:kdavinder@yahoo.com] 
> > Gesendet: Freitag, 16. Juli 2004 22:36
> > An: POI Users List
> > Betreff: formula return type
> > 
> > Hi,
> > How do I determine the return type of a formula?
> Is
> > there an API provided to do this or do I need to
> > checkout the formula and then determine its return
> > type.
> > 
> > Thanks,
> > Davinder
> > 
> > 
> > 		
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Mail - 50x more storage than other
> providers!
> > http://promotions.yahoo.com/new_mail
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > poi-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> > poi-user-help@jakarta.apache.org
> > 
> > 
> > 
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > poi-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> > poi-user-help@jakarta.apache.org
> > 
> > 
> 
> 
> 
> 		
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail - 50x more storage than other providers!
> http://promotions.yahoo.com/new_mail
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> poi-user-help@jakarta.apache.org
> 
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> poi-user-help@jakarta.apache.org
> 
> 



		
__________________________________
Do you Yahoo!?
Vote for the stars of Yahoo!'s next ad campaign!
http://advision.webevents.yahoo.com/yahoo/votelifeengine/


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org


AW: AW: formula return type

Posted by "KHZ (SAW)" <ka...@sawag.com>.
Sorry.

Check the string value for "". I was thinking something else when
writing.

Regards,	Karl-Heinz.


-----Ursprüngliche Nachricht-----
Von: KHZ (SAW) [mailto:karl-heinz.zengerle@sawag.com] 
Gesendet: Montag, 19. Juli 2004 17:10
An: 'POI Users List'
Betreff: AW: AW: formula return type

Hi Davinder.

Try it with first fetching the string value and checking for 0. I think
the fetching the numeric value returns 0 and not NaN.

I'ld expect that booleans are 0/1.

Regards,	Karl-Heinz.


-----Ursprüngliche Nachricht-----
Von: Davinder Kohli [mailto:kdavinder@yahoo.com] 
Gesendet: Montag, 19. Juli 2004 16:28
An: POI Users List
Betreff: Re: AW: formula return type

Thank you Karl.
That's exactly what I am doing. I wanted to go a step
further and read in the contents of a cell containing
a logical formula.
1. When reading it as a string I get "", it would be
nice if I could read it as getBooleanCellValue().

2. I also wanted to determine if the cell (containing
a formula which returns numeric value) is of type
date.

double cellValue = theCell.getNumericCellValue();
if (Double.isNaN(cellValue)){
  // string value
  String strCell = theCell.getStringCellValue();
} else {
  // numeric
  ....
}


--- "KHZ (SAW)" <ka...@sawag.com> wrote:
> Hi Davinder.
> 
> Actually you can query it as a numeric or a string
> value. If you've
> chosen the wrong type the result is "" or 0.
> Unfortunately you don't see
> the type. You just can look for the most reasonable
> result.
> 
> Regards,	Karl-Heinz.
> 
> 
> -----Ursprüngliche Nachricht-----
> Von: Davinder Kohli [mailto:kdavinder@yahoo.com] 
> Gesendet: Freitag, 16. Juli 2004 22:36
> An: POI Users List
> Betreff: formula return type
> 
> Hi,
> How do I determine the return type of a formula? Is
> there an API provided to do this or do I need to
> checkout the formula and then determine its return
> type.
> 
> Thanks,
> Davinder
> 
> 
> 		
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail - 50x more storage than other providers!
> http://promotions.yahoo.com/new_mail
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> poi-user-help@jakarta.apache.org
> 
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> poi-user-help@jakarta.apache.org
> 
> 



		
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org


AW: AW: formula return type

Posted by "KHZ (SAW)" <ka...@sawag.com>.
Hi Davinder.

Try it with first fetching the string value and checking for 0. I think
the fetching the numeric value returns 0 and not NaN.

I'ld expect that booleans are 0/1.

Regards,	Karl-Heinz.


-----Ursprüngliche Nachricht-----
Von: Davinder Kohli [mailto:kdavinder@yahoo.com] 
Gesendet: Montag, 19. Juli 2004 16:28
An: POI Users List
Betreff: Re: AW: formula return type

Thank you Karl.
That's exactly what I am doing. I wanted to go a step
further and read in the contents of a cell containing
a logical formula.
1. When reading it as a string I get "", it would be
nice if I could read it as getBooleanCellValue().

2. I also wanted to determine if the cell (containing
a formula which returns numeric value) is of type
date.

double cellValue = theCell.getNumericCellValue();
if (Double.isNaN(cellValue)){
  // string value
  String strCell = theCell.getStringCellValue();
} else {
  // numeric
  ....
}


--- "KHZ (SAW)" <ka...@sawag.com> wrote:
> Hi Davinder.
> 
> Actually you can query it as a numeric or a string
> value. If you've
> chosen the wrong type the result is "" or 0.
> Unfortunately you don't see
> the type. You just can look for the most reasonable
> result.
> 
> Regards,	Karl-Heinz.
> 
> 
> -----Ursprüngliche Nachricht-----
> Von: Davinder Kohli [mailto:kdavinder@yahoo.com] 
> Gesendet: Freitag, 16. Juli 2004 22:36
> An: POI Users List
> Betreff: formula return type
> 
> Hi,
> How do I determine the return type of a formula? Is
> there an API provided to do this or do I need to
> checkout the formula and then determine its return
> type.
> 
> Thanks,
> Davinder
> 
> 
> 		
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail - 50x more storage than other providers!
> http://promotions.yahoo.com/new_mail
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> poi-user-help@jakarta.apache.org
> 
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> poi-user-help@jakarta.apache.org
> 
> 



		
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org


Re: AW: formula return type

Posted by Davinder Kohli <kd...@yahoo.com>.
Thank you Karl.
That's exactly what I am doing. I wanted to go a step
further and read in the contents of a cell containing
a logical formula.
1. When reading it as a string I get "", it would be
nice if I could read it as getBooleanCellValue().

2. I also wanted to determine if the cell (containing
a formula which returns numeric value) is of type
date.

double cellValue = theCell.getNumericCellValue();
if (Double.isNaN(cellValue)){
  // string value
  String strCell = theCell.getStringCellValue();
} else {
  // numeric
  ....
}


--- "KHZ (SAW)" <ka...@sawag.com> wrote:
> Hi Davinder.
> 
> Actually you can query it as a numeric or a string
> value. If you've
> chosen the wrong type the result is "" or 0.
> Unfortunately you don't see
> the type. You just can look for the most reasonable
> result.
> 
> Regards,	Karl-Heinz.
> 
> 
> -----Urspr�ngliche Nachricht-----
> Von: Davinder Kohli [mailto:kdavinder@yahoo.com] 
> Gesendet: Freitag, 16. Juli 2004 22:36
> An: POI Users List
> Betreff: formula return type
> 
> Hi,
> How do I determine the return type of a formula? Is
> there an API provided to do this or do I need to
> checkout the formula and then determine its return
> type.
> 
> Thanks,
> Davinder
> 
> 
> 		
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail - 50x more storage than other providers!
> http://promotions.yahoo.com/new_mail
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> poi-user-help@jakarta.apache.org
> 
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> poi-user-help@jakarta.apache.org
> 
> 



		
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org


AW: formula return type

Posted by "KHZ (SAW)" <ka...@sawag.com>.
Hi Davinder.

Actually you can query it as a numeric or a string value. If you've
chosen the wrong type the result is "" or 0. Unfortunately you don't see
the type. You just can look for the most reasonable result.

Regards,	Karl-Heinz.


-----Ursprüngliche Nachricht-----
Von: Davinder Kohli [mailto:kdavinder@yahoo.com] 
Gesendet: Freitag, 16. Juli 2004 22:36
An: POI Users List
Betreff: formula return type

Hi,
How do I determine the return type of a formula? Is
there an API provided to do this or do I need to
checkout the formula and then determine its return
type.

Thanks,
Davinder


		
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org


formula return type

Posted by Davinder Kohli <kd...@yahoo.com>.
Hi,
How do I determine the return type of a formula? Is
there an API provided to do this or do I need to
checkout the formula and then determine its return
type.

Thanks,
Davinder


		
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org


Re: invalid formula

Posted by Karl-Heinz Zengerle <ka...@sawag.com>.
Hi Avik.

Are you also able to evaluate all mapped formula (when a user calls the
getStringValue() or getNumericValue() method of a cell) within POI?

E.g. there are functions like SVERWEIS() where internally quite a lot
has to be done.

Regards, Karl-Heinz.


Am Di 06.07.2004 10:03 schrieb Avik Sengupta
<av...@itellix.com>:

> Excel stores an integer index for the inbuilt functions. POI knows the
> mappings between the ENGLISH function names and the indices. I think
> we
> have all the names upto office xp, but check in code to be sure.
> AbstractFunctionPtg.java
> 
> For names that are not recognised, POI will put in the integer for an
> user defined function. If that UDF is not defined in the excel
> template,
> Excel will show #NAME on opening the file. 
> 
> Regards
> -
> Avik
> 
> 
> PS. you had said urgent, sorry for the delay. 
> 
> On Fri, 2004-07-02 at 22:22, Karl-Heinz Zengerle wrote:
> > Hi world.
> > 
> > Are any Excel formulas (with valid function names) known which can't
> > be
> > evaluated in POI? The answer is urgent.
> > 
> > If the general answer isn't known then a statement about the lookup
> > functions (like SVERWEIS in German) would be welcome.
> > 
> > Regards, Karl-Heinz.
> > 
> > 
> > Am Mo 28.06.2004 15:21 schrieb Karl-Heinz Zengerle
> > <ka...@sawag.com>:
> > 
> > > Hi world.
> > > 
> > > How are invalid formula detected, e.g. a function NONSENSE() not
> > > existing in Excel? How will the application see that?
> > > 
> > > As Excel documents can also be created in OpenOffice e.g. the
> > > Bessel
> > > functions aren't available in Excel. Such files could be processed
> > > in
> > > POI. So such situations could occur in practice.
> > > 
> > > Regards, Karl-Heinz.
> > 
> > 
> > 
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: poi-user-help@jakarta.apache.org
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-user-help@jakarta.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org


Re: invalid formula

Posted by Karl-Heinz Zengerle <ka...@sawag.com>.
Thanks Avik.

If there's time I'll look into the code.

So I think where Excel shows #NAME also POI will not be able to map back
the UDF token and when getting the formula there will be a similar
effect. Do I understand it right?

Regards, Karl-Heinz.


Am Di 06.07.2004 10:03 schrieb Avik Sengupta
<av...@itellix.com>:

> Excel stores an integer index for the inbuilt functions. POI knows the
> mappings between the ENGLISH function names and the indices. I think
> we
> have all the names upto office xp, but check in code to be sure.
> AbstractFunctionPtg.java
> 
> For names that are not recognised, POI will put in the integer for an
> user defined function. If that UDF is not defined in the excel
> template,
> Excel will show #NAME on opening the file. 
> 
> Regards
> -
> Avik
> 
> 
> PS. you had said urgent, sorry for the delay. 
> 
> On Fri, 2004-07-02 at 22:22, Karl-Heinz Zengerle wrote:
> > Hi world.
> > 
> > Are any Excel formulas (with valid function names) known which can't
> > be
> > evaluated in POI? The answer is urgent.
> > 
> > If the general answer isn't known then a statement about the lookup
> > functions (like SVERWEIS in German) would be welcome.
> > 
> > Regards, Karl-Heinz.
> > 
> > 
> > Am Mo 28.06.2004 15:21 schrieb Karl-Heinz Zengerle
> > <ka...@sawag.com>:
> > 
> > > Hi world.
> > > 
> > > How are invalid formula detected, e.g. a function NONSENSE() not
> > > existing in Excel? How will the application see that?
> > > 
> > > As Excel documents can also be created in OpenOffice e.g. the
> > > Bessel
> > > functions aren't available in Excel. Such files could be processed
> > > in
> > > POI. So such situations could occur in practice.
> > > 
> > > Regards, Karl-Heinz.
> > 
> > 
> > 
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: poi-user-help@jakarta.apache.org
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-user-help@jakarta.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org


Re: invalid formula

Posted by Avik Sengupta <av...@itellix.com>.
Excel stores an integer index for the inbuilt functions. POI knows the
mappings between the ENGLISH function names and the indices. I think we
have all the names upto office xp, but check in code to be sure.
AbstractFunctionPtg.java

For names that are not recognised, POI will put in the integer for an
user defined function. If that UDF is not defined in the excel template,
Excel will show #NAME on opening the file. 

Regards
-
Avik


PS. you had said urgent, sorry for the delay. 

On Fri, 2004-07-02 at 22:22, Karl-Heinz Zengerle wrote:
> Hi world.
> 
> Are any Excel formulas (with valid function names) known which can't be
> evaluated in POI? The answer is urgent.
> 
> If the general answer isn't known then a statement about the lookup
> functions (like SVERWEIS in German) would be welcome.
> 
> Regards, Karl-Heinz.
> 
> 
> Am Mo 28.06.2004 15:21 schrieb Karl-Heinz Zengerle
> <ka...@sawag.com>:
> 
> > Hi world.
> > 
> > How are invalid formula detected, e.g. a function NONSENSE() not
> > existing in Excel? How will the application see that?
> > 
> > As Excel documents can also be created in OpenOffice e.g. the Bessel
> > functions aren't available in Excel. Such files could be processed in
> > POI. So such situations could occur in practice.
> > 
> > Regards, Karl-Heinz.
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org