Select Case e.DataCol.name Case "服务商","月份","业务类型" If e.DataRow("业务类型") = "xxx" Then e.DataRow("金额") = DataTables("仓库租金").Compute("sum(成本)","[服务商]= '" & e.DataRow("服务商") & "' And [月份]= '" & e.DataRow("月份") & "'And [业务类型]= '" & e.DataRow("业务类型") & "'" ) e.DataRow("金额") = DataTables("国内物流").Compute("sum(运输成本)","[服务商]= '" & e.DataRow("服务商") & "' And [月份]= '" & e.DataRow("月份") & "'And [业务类型]= '" & e.DataRow("业务类型") & "'" ) e.DataRow("业务量") = DataTables("国内物流").Compute("count(箱号)","[服务商]= '" & e.DataRow("服务商") & "' And [月份]= '" & e.DataRow("月份") & "'And [业务类型]= '" & e.DataRow("业务类型") & "'" ) ElseIf e.DataRow("业务类型") = "bbbb" Then e.DataRow("金额") = DataTables("出库").Compute("sum(运输成本)","[服务商]= '" & e.DataRow("服务商") & "' And [月份]= '" & e.DataRow("月份") & "'And [业务类型]= '" & e.DataRow("业务类型") & "'" ) e.DataRow("业务量") = DataTables("出库").Compute("count(箱号)","[服务商]= '" & e.DataRow("服务商") & "' And [月份]= '" & e.DataRow("月份") & "'And [业务类型]= '" & e.DataRow("业务类型") & "'" ) ElseIf e.DataRow("业务类型") = "ccc" Then e.DataRow("金额") = DataTables("入库").Compute("sum(装卸成本)","[服务商]= '" & e.DataRow("服务商") & "' And [月份]= '" & e.DataRow("月份") & "'And [业务类型]= '" & e.DataRow("业务类型") & "'" ) e.DataRow("业务量") = DataTables("入库").Compute("count(箱号)","[服务商]= '" & e.DataRow("服务商") & "' And [月份]= '" & e.DataRow("月份") & "'And [业务类型]= '" & e.DataRow("业务类型") & "'" ) ElseIf e.DataRow("业务类型") = "abc" Then e.DataRow("金额") = DataTables("进口账单").Compute("sum(成本合计)","[服务商]= '" & e.DataRow("服务商") & "' And [月份]= '" & e.DataRow("月份") & "'And [业务类型]= '" & e.DataRow("业务类型") & "'" ) e.DataRow("业务量") = DataTables("进口账单").Compute("count(报关单号)","[服务商]= '" & e.DataRow("服务商") & "' And [月份]= '" & e.DataRow("月份") & "'And [业务类型]= '" & e.DataRow("业务类型") & "'" ) End If End Select
|