If e.DataCol.Name = "客户编号" Then Dim sum1 As Double = DataTables("订单").compute("sum(金额)","客户编号 = '" & e.DataRow("客户编号") & "'") Dim sum2 As Double = DataTables("订单增量").compute("sum(金额2)","客户编号 = '" & e.DataRow("客户编号") & "'") Dim sum3 As Double = DataTables("订单").compute("sum(未付金额)","客户编号 = '" & e.DataRow("客户编号") & "'") Dim sum4 As Double = DataTables("订单增量").compute("sum(未付金额)","客户编号 = '" & e.DataRow("客户编号") & "'") e.DataRow("订单金额合计") = sum1 + sum2 e.DataRow("未付款合计") = sum3 + sum4 End If
|