I'm hoping someone can help me with ClosedXML as I'm new to Excel exporting and from what I've seen of ClosedXML the documentation is fairly limited in certain areas.
At the moment I'm putting data into a Datatable, formatting rows to their correct type and exporting with the correct layout.
The problem occurs when I attempt to export one row containing a repeating formula in each cell.
I have tried to add the formula simply as a string which I can then highlight and convert when the file is exported, this is obviously not Ideal. I found a class in XML called XLFormula
which has absolutely no documentation but assume I should be doing something with this.
At the moment I have (commented out is the way I was using XLFormula
, was trying to pass XLFormula
the formula as a string and set as total bid per unit):
dt.Columns.Add("Qty", typeof(int));
dt.Columns.Add("Bid Per Unit GBP", typeof(double));
dt.Columns.Add("Total Bid GBP"); //typeof(XLFormula)
foreach (DataRow dr in dt.Rows)
{
//XLFormula totalBidFormula = new XLFormula();
dr["Qty"] = 1;
dr["Bid Per Unit GBP"] = 0.00;
dr["Total Bid GBP"] = "=[@Qty]*[@[Bid Per Unit GBP]]";
Any Help would be greatly appreciated. If what I'm trying to do is impossible with ClosedXML please let me know and if you could suggest an alternative XML exporter (even if its paid) that would help!