填充完毕添加一行,直接compoute
For c As Integer = 0 To tb.Cols.Count -1 '逐列设置和填入内容
rt.Cells(0,c).Text = tb.Cols(c).Name '列名作为标题
rt.Cells(0,c).Style.TextAlignHorz = prt.AlignHorzEnum.Center '标题内容水平居中
rt.Cols(c).Width = tb.Cols(c).PrintWidth '列宽等于实际列宽
If tb.Cols(c).IsNumeric Orelse tb.Cols(c).IsDate Then '如果是数值或日期列
rt.Cols(c).Style.TextAlignHorz = prt.AlignHorzEnum.Right '数据水平靠右
End If
For r As integer = 0 To tb.Rows.Count -1 '开始填入该列内容
rt.Cells(r + 1, c).Text = tb(r,c)
Next
If tb.Cols(c).IsNumeric then rt.Cells(tb.Rows.Count + 1, c).Text = tb.compoute(“sum(“ & tb.Cols(c).Name & ”)”)
Next