Select Case e.DataCol.Name Case "数值" For Each dr As DataRow In e.DataTable.Select("[_SortKey] >= " & e.DataRow("_SortKey")) If dr.IsNull("数值") Then dr("累计") = Nothing Else Dim Val1 As Double = e.DataTable.Compute("Sum(数值)","[_SortKey] <= " & dr("_SortKey")) dr("累计") = Val1 End If Next End Select