最后一行手工合计,如:
……
For r As Integer = 0 To dt.Rows.Count - 1 '填入数据
For c As Integer = 0 To dt.Cols.Count -1
Sheet(r +1, c).Value = dt.rows(r)(c)
Next
Next
If Tables("表A").GrandTotal Then
Dim Style As Xls.Style = Book.NewStyle
Style.BackColor = Color.PaleGreen
Dim i As Integer = dt.Rows.Count + 1
Sheet(i, 0).Value = "合计"
sheet(i, 0).style = style
For c As Integer = 1 To dt.Cols.Count -1
sheet(i, c).style = style
If dt.Cols(c).GrandTotal Then
Sheet(i, c).Value = dt.Compute("sum(" & dt.Cols(c).Name & ")")
End If
Next
End If
……