参考
If e.DataCol.Name = "产品编号" Then e.DataRow("销售数量") = DataTables("订单明细").Compute("Sum(数量)","[产品编号] = '" & e.DataRow("产品编号") & "'")End If