I am using GemBox Spreadsheet 47.0.35.1418 and .NET 4.7.1.
I have tried to add a row with the total values at the end of a table that was created in a template file beforehand.
public void SetTotalsRow(string tableName, bool hasTotalsRow)
{
var table = worksheet.Tables[tableName];
table.HasTotalsRow = hasTotalsRow;
}
When opening the file, Excel warns that the file needs to be repaired because of the corrupted table. Without this row, the file can be opened normally.
The row still isn’t formatted correctly after repairing and appears as an additional row without the functions (Sum, Min,…) as seen in the picture.
Afterwards, I have created a new table only with GemBox and added the TotalsRow which worked as intended. So I suppose the problem is using an existing table.
I’d like to keep the formatting of the template table, so I’d like to know how this row can be added without creating a new table.