在DataRowDeleting事件设置代码。
为了保证结果正确,将字表的数量列设为0,再计算:
e.DataRow("Qty") = 0e.DataRow("Amount") = 0dim pr as datarow = e.Dayarow.GetParentRow("主表")
pr("TotalQty") = DataTables("子表").Compute("Sum(Qty)","[SONO] = '" & pr("SaleOrder")("Number") & "'")pr("Total") = DataTables("子表").Compute("Sum(Amount)","[SONO] = '" & pr("SaleOrder")("Number") & "'")