If e.DataCol.Name = "地区" Then e.DataTable.replacefor("签订份数",Nothing ,"[地区]= '" & e.DataRow("地区") & "' ") Dim Filter As String = "[地区] = '" & e.NewValue & "'" e.DataRow("合同金额") = DataTables("未完合同").Compute("Sum(合同金额)", Filter) Dim Prs As List(Of String) Prs = DataTables("未完合同").GetValues("客户户名","地区= '"& e.newvalue &"'") For Each Pr As String In Prs e.DataRow("签订份数")+=DataTables("合同明细").Compute("count(客户户名)","客户户名='"& Pr &"'") e.DataRow("未完份数")+=DataTables("合同明细").Compute("count(客户户名)","客户户名='"& Pr &"' and 未完金额 <> 0 ") Next End If e.DataRow("执行份数") = e.DataRow("签订份数")-e.DataRow("未完份数")
|