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

CalculatedValue with Named Ranges in Formula

Hey, I like XlsIO and all; I find it very easy and convenient to use! The CalculatedValue is a very strong bonus for this... because getting calculated values on Excel seem a little hard.

CalculatedValue seems to work fine with formulae like =A1+A2, but when I apply Named Ranges into the formula (e.g. =Var1+Var2), my CalculatedValue returns me an empty string although the calculated value shows nicely on the Spreadsheet control.

Please do tell me if I'm doing anything wrong, or that CalculatedValue does not work with named ranges at this point of time. Thanks! :)

1 Reply

MK Manoj Kumar G M Syncfusion Team May 18, 2012 11:36 AM UTC

Hi Matthew,

Thank you for choosing Syncfusion products.

Essential XlsIO includes support for enabling the calculations of Essential Calculate supported formulas that are added at runtime to the worksheet and the computed value will be set to the “CalculatedValue” property associated to the “IRange” object. The following code snippet illustrates how to enable the sheet formula calculations.

[C#]

IWorksheet sheet = workbook.Worksheets[0];

//Formula calculation is enabled for the sheet.

sheet.EnableSheetCalculations();

string computedValue = sheet.Range["C1"].CalculatedValue;

Please go through our documentation in the link below.

http://help.syncfusion.com/UG/Reporting/XlsIO/Windows%20Forms/default.htm#!Documents/addingcalculationenginetoanapplication.htm

We have attached the sample in the below link. Please make use of this sample and let us know if this helps you.

SampleLink:

http://www.syncfusion.com/downloads/Support/DirectTrac/93766/NamedRanges-1274090944.zip

Please let us know if you require any further clarifications.

Regards,
Manojkumar.

 


Loader.
Live Chat Icon For mobile
Up arrow icon