Wrong result of CaculateFormulaValue

Technical support for Spire.XLS

Moderators: iceblue support, Flash, Manager

Wrong result of CaculateFormulaValue

Postby VincentB » Thu Jul 27, 2017 11:51 am

Hello,

I get a worong result with CaculateFormulaValue() method with some values.

Code: Select all
var workbook = new Workbook();
var formule = "50000.10 < 50000";
var result = (bool)workbook.CaculateFormulaValue(formule); // result = false : OK
formule = "49999.10 < 50000";
result = (bool)workbook.CaculateFormulaValue(formule); // result = true : OK
formule = "1404129.7076516 < 50000";
result = (bool)workbook.CaculateFormulaValue(formule); // result = true : Fail


Do you reproduce the issue ?

Thanks
VincentB
 
Posts: 78
Joined: Thu Sep 15, 2016 9:44 am

Re: Wrong result of CaculateFormulaValue

Postby Jane.Bai » Fri Jul 28, 2017 2:37 am

Hello VincentB,

Thanks for your inquiry.
After an initial test with the latest hotfix(Spire.XLS Pack Hotfix Version:7.12.55), I got the correct result on my side. Please use this version to have a try.

Sincerely,
Jane
E-iceblue support team
User avatar
Jane.Bai
 
Posts: 348
Joined: Tue Nov 29, 2016 1:47 am

Re: Wrong result of CaculateFormulaValue

Postby VincentB » Fri Jul 28, 2017 8:03 am

Hello,

I have install the latest hotfix but i always reproduce the isssue.
The comparison is valid if it's make on integer values.

Code: Select all
var formule = "1404129 < 50000";
var result = (bool)workbook.CaculateFormulaValue(formule); // result = false OK
formule = "1404129.7076516 < 50000";
result = (bool)workbook.CaculateFormulaValue(formule); // result = true Fail


Problem maybe come from decimal values.
Do you have the same result ?

Thanks
VincentB
 
Posts: 78
Joined: Thu Sep 15, 2016 9:44 am

Re: Wrong result of CaculateFormulaValue

Postby Jane.Bai » Fri Jul 28, 2017 8:29 am

Hello VincentB,

I still get the correct result. See the below screenshoot.
11227.png
11227.png (14.27 KiB) Viewed 194 times

Please check your dlls again, below are the details in the latest 7.12.55.
Spire.XLS.dll 7.12.55.6040
Spire.Pdf.dll 3.9.222.6040
Spire.License.dll 1.3.6.40
Spire.Common.dll 1.2.693.6040

Sincerely,
Jane
E-iceblue support team
User avatar
Jane.Bai
 
Posts: 348
Joined: Tue Nov 29, 2016 1:47 am

Re: Wrong result of CaculateFormulaValue

Postby Jane.Bai » Wed Aug 02, 2017 8:06 am

Hello VincentB,

How is the issue now?
Could you please give us some feedback at your convenience?

Sincerely,
Jane
E-iceblue support team
User avatar
Jane.Bai
 
Posts: 348
Joined: Tue Nov 29, 2016 1:47 am

Re: Wrong result of CaculateFormulaValue

Postby VincentB » Mon Aug 07, 2017 1:11 pm

Hello,

We check again our dll, and it's still failling.
We work on French computer.

if we call the line bellow befor our test, it's work, so it's depend on culture :
Code: Select all
 Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;


Code: Select all
            var workbook = new Workbook();

            var formule = "50000.10 < 50000";
            var result = (bool)workbook.CaculateFormulaValue(formule); // result = false : OK

            formule = "49999.10 < 50000";
            result = (bool)workbook.CaculateFormulaValue(formule); // result = true : OK

            formule = "1404129 < 50000";
            result = (bool)workbook.CaculateFormulaValue(formule); // result = false : OK

            formule = "1404129.7 < 50000";
            result = (bool)workbook.CaculateFormulaValue(formule); // result = true : Fail


Best regards

VincentB
VincentB
 
Posts: 78
Joined: Thu Sep 15, 2016 9:44 am

Re: Wrong result of CaculateFormulaValue

Postby Jane.Bai » Tue Aug 08, 2017 2:08 am

Hello VincentB,

I have reproduced the issue when I set the language and region to French(France). Anyway, I have referred this issue to our dev team, once there's any good news, I will let you know.
So sorry for the inconvenience caused.

Sincerely,
Jane
E-iceblue support team
User avatar
Jane.Bai
 
Posts: 348
Joined: Tue Nov 29, 2016 1:47 am

Re: Wrong result of CaculateFormulaValue

Postby Jane.Bai » Tue Aug 22, 2017 5:55 am

Hello VincentB,

Glad to inform that the hotfix is available now, please download the Spire.XLS Pack Hotfix Version:7.12.76 to have a check.

Sincerely,
Jane
E-iceblue support team
User avatar
Jane.Bai
 
Posts: 348
Joined: Tue Nov 29, 2016 1:47 am

Re: Wrong result of CaculateFormulaValue

Postby VincentB » Wed Aug 23, 2017 9:36 am

Hello,

I have test Spire.XLS Pack Hotfix Version:7.12.76
and tests send before works !

Code: Select all
formule = "1404129.7076516 < 50000";
result = (bool)workbook.CaculateFormulaValue(formule); // result = true : Correct !


But i have issues with others conditions, for example LessOrEquals :
Code: Select all
var formule = "1404129.7076516 < 0";
var result = (bool)workbook.CaculateFormulaValue(formule); // result = false : OK
formule = "1404129.7076516 <= 0";
result = (bool)workbook.CaculateFormulaValue(formule); // result = true : Fail


So like said precedently, i set CultureInfo.InvariantCulture when i use CaculateFormulaValue and it seems to work !

Thanks
VincentB
 
Posts: 78
Joined: Thu Sep 15, 2016 9:44 am

Re: Wrong result of CaculateFormulaValue

Postby Jane.Bai » Wed Aug 23, 2017 10:02 am

Hello VincentB,

Thanks for your inquiry.
I have noticed the issue and logged it to our dev team. Once there's any good news, I will let you know.
Sorry for the inconvenience caused.

Sincerely,
Jane
E-iceblue support team
User avatar
Jane.Bai
 
Posts: 348
Joined: Tue Nov 29, 2016 1:47 am


Return to Spire.XLS

Who is online

Users browsing this forum: No registered users and 0 guests