We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

what javascript is for Essential Calculate's CalcQuick?

Hi,
We use Essential Calculate to parse and calculate some formulas. We actually just use CalcQuick or Indexer method for calculation. Your this link https://help.syncfusion.com/js/calculate/getting-started says ej.web.all.min.js needs to be added. But this file is too big and seems including everything (most of which we don't need). So to use CalcQuick, what specific javascript file shall we add in our project?

Another  question regarding the use of calcQuick. when something goes wrong with the formula, where shall we fetch the error message? In our test, it seems when formula parsing fails, getKeyValue() for a formula calculation returns nothing, and in some cases, it returns something like #name. So if calculation returns nothing or returns something, how shall we know if it is calculation result or it is error message? Can you provide error handling examples when calcQuick is used?

Thanks!
Hui  

 

3 Replies

MG Mohanraj Gunasekaran Syncfusion Team August 24, 2017 01:17 PM UTC

Hi Hui, 

Thanks for using Syncfusion product. 

Query 
Solution 
To use CalcQuick, what specific javascript file shall we add in our project? 
In order to use the calculate formulas alone, you can use the ej.Calculate.js script file which can be download from CSG. 
 
Please refer the following UG link to create CSG, 
Another  question regarding the use of calcQuick. when something goes wrong with the formula, where shall we fetch the error message?  
We can understand your scenario. By default, we have handled the error in our source and return the value like (#Name, #Value, (etc)). So, there is no support to get the errors in formula calculation. 

If you did not get any error message. Please share that formula with value to reproduce the scenario. It will be helpful to provide the solution at the earliest. 
 

Regards, 
Mohanraj G 
 



HZ hui zheng August 24, 2017 01:52 PM UTC

Hi Mohanraj,

Thank you for the solutions. They are working. 

Regarding error message, if there is a typo in formula, i got undefined value ánd there is no error message. One example, SQRT([A] * [A] +ads [B]).  However this is not big problem for us. If getKeyValue() returns undefined value, we suppose there is an error in formula.


Thanks

Hui





PM Piruthiviraj Malaimelraj Syncfusion Team August 26, 2017 05:57 AM UTC

Hi Hui, 

Thanks for your update, 

We could able to understand your scenario and the given formula is seeming like that you have used custom function in SQRT formula. So, can you please confirm us whether you have used any custom function is formula? Here we have attached the simple sample with CalcQuick customization. If possible, modify the attached sample with your formula (custom function) customization. It would be more helpful for us to analyze this reported scenario at our end provide the better solution at the earliest, 

Sample link: 

Thanks for your understandings, 

Regards, 
Piruthiviraj 


Loader.
Live Chat Icon For mobile
Up arrow icon