For r As Integer = 0 To tb.Rows.Count -1 '开始填入该列内容
If tb.Cols(ColNames(c)).IsNumeric Then
rt.Cells(r + 1, c).Text = format(tb.Rows(r)(ColNames(c)),"0.00")
Else
rt.Cells(r + 1, c).Text = tb.Rows(r)(ColNames(c))
End If
Next
Next
rt.Rows.Count = rt.Rows.Count + 1
Dim cnt As Integer = rt.Rows.Count - 1
rt.Cells(cnt,0).Text = "收入合计"
For c As Integer = 0 To ColNames.Count - 1 '逐列设置和填入内容
If tb.Cols(ColNames(c)).IsNumeric Then
rt.Cells(cnt,c).Text = format(tb.Compute("Sum(" & ColNames(c) & ")"), "0.00")
End If
Next