If e.DataCol.Name = "让利额" OrElse e.DataCol.Name = "运费" OrElse e.DataRow.Name = "合计金额" Then
If e.Datarow.IsNull("让利额") OrElse e.DataRow.IsNull("运费") Then
e.DataRow("实际金额") = e.DataRow("合计金额")
Else
e.DataRow("实际金额") = e.DataRow("合计金额") - e.DataRow("让利额") - e.DataRow("运费")
End If
End If