| View previous topic :: View next topic |
| Author |
Message |
SergeM Super User

Joined: 09 Sep 2003 Posts: 3211 Location: Troyes France
|
Posted: Sat Nov 15, 2003 8:40 am Post subject: Compute from a group of Cells |
|
|
When I read the SUN documentation on OooBasic programming I see that only the functions :
SUM, COUNT,COUNTNUMS,MAX,MIN,PRODUCT,STDEV,VAR,VARP,STDEVP can be computed with a :
| Code: | | oGroup.computeFunction(com.sun.star.sheet.GeneralFunction.XXXX) |
Is it realy true ?
I can't test it because I have a french version of Ooo and I don't know exacly the names of the english functions ...
Yes I understand now during the redaction of this question.
It's probably true because the others funtions don't work with a group of cells.
Then I ask an other question. Is there a way to compute the other functions without using a
| Code: | | oCell.Formula="=SUM....." |
I mean without using a cell of a sheet but obtaining directly the result in a OooBASIC variable ? (For example CROSSCORRELATION : sorry I don't know the english name of COVARIANCE)
To explain my problem with french and english name to the people who use only an english version of Ooo : with a french version you write in OooBASIC
| Code: | | oGroup.computeFunction(com.sun.star.sheet.GeneralFunction.SUM) |
with the english name but
| Code: | | oCell.Formula="=SOMME....." |
with the french name ....
I have not already try to give this second line to an english version of Ooo but i suspect that it doesn't work. _________________ Linux & Windows OOo3.0
UNO & C++ : WIKI
http://wiki.services.openoffice.org/wiki/Using_Cpp_with_the_OOo_SDK
In French
http://wiki.services.openoffice.org/wiki/Documentation/FR/Cpp_Guide |
|
| Back to top |
|
 |
SergeM Super User

Joined: 09 Sep 2003 Posts: 3211 Location: Troyes France
|
Posted: Sat Nov 15, 2003 9:58 am Post subject: |
|
|
I have understood something since i post the previous message : the difference between oCell.Formula and oCell.FormulaLocal. Then there is a mistake in the previous post.
It's not
| Code: | | Cell.Formula="=SOMME....." |
with french name ....
but
| Code: | | Cell.FormulaLocal="=SOMME....." |
with french name ....
I then discover this possibility to use only english names. Is then the code more portable ?
How does work a program with
| Code: | | Cell.FormulaLocal="=SOMME....." |
with an english version of OOo ?
[/code] _________________ Linux & Windows OOo3.0
UNO & C++ : WIKI
http://wiki.services.openoffice.org/wiki/Using_Cpp_with_the_OOo_SDK
In French
http://wiki.services.openoffice.org/wiki/Documentation/FR/Cpp_Guide |
|
| Back to top |
|
 |
dfrench Moderator

Joined: 03 Mar 2003 Posts: 1605 Location: Wellington, New Zealand
|
Posted: Sat Nov 15, 2003 3:34 pm Post subject: |
|
|
| Quote: | How does work a program with
Code:
Cell.FormulaLocal="=SOMME....."
with an english version of OOo ? |
The result same as entering the formula directly into a cell ... #NAME? error on the spreadsheet ... program executes fine.
| Quote: | | I don't know the english name of COVARIANCE | That will do fine in english as well ... the function is COVAR().
I do not think that you can execute any spreadsheet functions other than those listed using com.sun.star.sheet.GeneralFunction.XXX.
The underlying formula is generally well documented so you could code it in Basic and refer to the cells containing the arguments but simply putting the function into the spreadsheet as you have done seems a simpler approach. |
|
| Back to top |
|
 |
SergeM Super User

Joined: 09 Sep 2003 Posts: 3211 Location: Troyes France
|
|
| Back to top |
|
 |
SergeM Super User

Joined: 09 Sep 2003 Posts: 3211 Location: Troyes France
|
Posted: Tue Nov 18, 2003 1:15 am Post subject: |
|
|
The OOoBasic code
| Code: | | oGroup.computeFunction(com.sun.star.sheet.GeneralFunction.VAR) |
and
| Code: | | oGroup.computeFunction(com.sun.star.sheet.GeneralFunction.VARP) |
and
| Code: | | oGroup.computeFunction(com.sun.star.sheet.GeneralFunction.STDEVP) |
don't work. It returns me always 0
I have no problem with
| Code: | oGroup.computeFunction(com.sun.star.sheet.GeneralFunction.MAX)
oGroup.computeFunction(com.sun.star.sheet.GeneralFunction.MIN)
oGroup.computeFunction(com.sun.star.sheet.GeneralFunction.AVERAGE)
oGroup.computeFunction(com.sun.star.sheet.GeneralFunction.SUM)
|
Any body to confirm or infirm ? _________________ Linux & Windows OOo3.0
UNO & C++ : WIKI
http://wiki.services.openoffice.org/wiki/Using_Cpp_with_the_OOo_SDK
In French
http://wiki.services.openoffice.org/wiki/Documentation/FR/Cpp_Guide |
|
| Back to top |
|
 |
dfrench Moderator

Joined: 03 Mar 2003 Posts: 1605 Location: Wellington, New Zealand
|
|
| Back to top |
|
 |
dfrench Moderator

Joined: 03 Mar 2003 Posts: 1605 Location: Wellington, New Zealand
|
|
| Back to top |
|
 |
|