此主题相关图片如下:捕获2.png

用下面代码 Case "投资金额","所属团队" 的时候只能填充该团队的第一个行,如何让填充等于团队的 团队业务汇总所有行
Select Case e.DataCol.Name
Case "投资金额","业务员"
If e.DataRow.IsNull("业务员") = False Then
Dim dr As DataRow = DataTables("工资表").Find("姓名='" & e.DataRow("业务员") & "'")
If dr Is Nothing Then
dr = DataTables("工资表").AddNew()
dr("姓名") = e.DataRow("业务员")
End If
dr("个人业务汇总") = e.DataTable.Compute("sum(投资金额)","业务员='" & e.DataRow("业务员") & "'")
End If
Case "投资金额","所属团队"
If e.DataRow.IsNull("所属团队") = False Then
Dim dr As DataRow = DataTables("工资表").Find("所属团队='" & e.DataRow("所属团队") & "'")
If dr Is Nothing Then
dr = DataTables("工资表").AddNew()
dr("所属团队") = e.DataRow("所属团队")
End If
dr("团队业务汇总") = e.DataTable.Compute("sum(投资金额)","所属团队='" & e.DataRow("所属团队") & "'")
End If
End Select