这是专业报表中的一段代码,红色代码想实现在该表的最后一行的相应列做数据汇总
Rows = Tables("查询汇总").Rows(i).DataRow.GetChildRows("银行明细表")
For r As Integer = 0 To Rows.Count - 1
rt.Cells(r+1,0).Text = rows(r)("交易日期")
rt.Cells(r+1,1).Text = rows(r)("交易账号")
rt.Cells(r+1,2).Text = rows(r)("交易卡号")
rt.Cells(r+1,3).Text = rows(r)("交易户名")
rt.Cells(r+1,4).Text = rows(r)("交易内容")
rt.Cells(r+1,5).Text = rows(r)("借方金额")
rt.Cells(r+1,6).Text = rows(r)("贷方金额")
rt.Cells(r+1,7).Text = rows(r)("余额")
rt.Cells(r+1,8).Text = rows(r)("对方户名")
rt.Cells(r+1,9).Text = rows(r)("对方账号")
rt.rows(r+1).Style.Borders.Top = New prt.LineDef(0.3,Color.black)
Next
rt.Cells(Rows.Count,5).Text = Tables("银行明细表").DataTable.Compute("sum(借方金额)","查证姓名='" & tbl.Rows(i)("交易户名") & "'")