R1C1 Formula from DataTable

I've got something like that :

DataTable dt = new DataTable("REQresponse");
dt.Columns.Add("item_id");
dt.Columns.Add("conv_price");
dt.Columns.Add("formula");
foreach (DataRow itemDr in rows)
{
dt.ImportRow(itemDr);
dt.Rows[dt.Rows.Count - 1]["formula"] = "=LC(-2)*LC(-1)";
}
marker.AddVariable("REQresponse" + supDr["sup_id"].ToString(), dt);

I've got 2 problems with the R1C1 formula.
First of all, the formula is localized, R1C1 for english system, L1C1 for french system etc....
The second problem is that it says :
Syncfusion.XlsIO.Implementation.Exceptions.ParseException:
LC isn't custom function. at position 1. Formula: LC(-2)*LC(-1), Position: 3

How to put a formula in a cell on each row created from the population of an excel from a DataTable ?

Thanks,
Greg

1 Reply

MW Melba Winshia Syncfusion Team May 24, 2007 01:02 PM UTC

Hi Greg,

I created a sample to put a formula in a cell on each row created from the population of an excel from a DataTable. Here is the sample for your reference:

http://websamples.syncfusion.com/samples/XlsIO.Web/4.4.0.51/61332/main.htm

Note:
----

Please use R1C1 and not L1C1

Please take a look at the sample above and kindly let me know if this helps you.

Thanks,
Melba

Loader.
Up arrow icon