Free Support Forum - aspose.com

Why Total Row shows the word 'total'?

I display Total Row like this:
worksheet.ListObjects[0].ShowTotals = true;
worksheet.ListObjects[0].ListColumns[0].TotalsCalculation = TotalsCalculation.None;
worksheet.ListObjects[0].ListColumns[1].TotalsCalculation = TotalsCalculation.Sum;

However, the first cell in this row contains the word ‘total’ and I cannot remove it:
worksheet.Cells[6, 0].PutValue(String.Empty);

How can I remove this word?
It also applies bold to this cell which I cannot overwrite:

Style firstCellStyle = workbook.CreateStyle();
firstCellStyle.Font.Size = 9;
firstCellStyle.Font.Color = StyleHelper.ColorRed;
firstCellStyle.Font.IsBold = false;
int index = tableStyle.TableStyleElements.Add(TableStyleElementType.FirstTotalCell);
tableStyle.TableStyleElements[index].SetElementStyle(firstCellStyle);

@grubyrychu,

Thanks for the code segment and details.

Well, I think this is default behavior of MS Excel for ListObject/Table that prints Total in the bottom row.
You may try to add a line to your code segment to accomplish the task:
e.g
Sample code:

worksheet.ListObjects[0].ShowTotals = true;

worksheet.ListObjects[0].ListColumns[1].TotalsCalculation = TotalsCalculation.Sum;

worksheet.ListObjects[0].PutCellValue(6, 0, String.Empty);

Hope, this helps a bit.

Thanks a lot, PutCellValue helped.

@grubyrychu,

Good to know that your issue is sorted out by the suggested code. Feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.