Select Case e.DataCol.Name
Case "名称","年月","编号"
If e.DataRow.IsNull("名称") OrElse e.DataRow.IsNull("年月") OrElse e.DataRow.IsNull("编号") Then
Else
Dim filter As String = "名称='" & e.DataRow("名称") & "' and 年月='" & e.DataRow("年月") & "' and 编号='" & e.DataRow("编号") & "'"
Dim vl As Double = e.DataTable.Compute("sum(余额)",filter)
Dim dr As DataRow = e.DataTable.Find(filter,"[_Identify] desc")
e.DataTable.ReplaceFor("金额",Nothing,filter)
If dr IsNot Nothing Then
dr("金额") = vl
End If
End If
End Select