I am trying to get a totals row built in SharePoint C# webpart Excel export. However, when I using the code below I get a #Ref! error in Excel (I commented out the section that is giving this error). If I use the .CreateTable method instead
of the .AsTable() method I get a repaired Excel error. Am I doing something wrong or is this an issue with SharePoint and Excel export?
var table = tableRange.AsTable();
table.ShowTotalsRow = true;
//table.Field(2).TotalsRowFunction = XLTotalsRowFunction.Sum;