Click or drag to resize

IListObject DisplayTotalRow Property

Gets or sets a value indicating whether the Total row is visible.
Examples
The following code illustrates how to enable it by setting it to "True" and show the sum of values in second and third columns in the totals row:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Create table</para><para>IListObject table1 = worksheet.ListObjects.Create("Table1", worksheet["A1:C6"]);</para><para>//Show total row</para><para>table1.DisplayTotalRow = true;</para><para>table1.Columns[0].TotalsRowLabel = "Total";</para><para>table1.Columns[1].TotalsCalculation = ExcelTotalsCalculation.Sum;</para><para>table1.Columns[2].TotalsCalculation = ExcelTotalsCalculation.Sum;</para><para>//Save to file</para><para>workbook.SaveToFile("Table.xlsx");</para>

Namespace: Spire.Xls.Core
Assembly: Spire.XLS (in Spire.XLS.dll) Version: 15.4.0.0 (15.4.0.5046)
Syntax
bool DisplayTotalRow { get; set; }

Property Value

Type: Boolean
See Also