Select Case e.DataCol.Name Case "本工序","规格型号" If e.DataRow("本工序") <> "" AndAlso e.DataRow("规格型号") <> "" Then Dim sum As Integer = DataTables("日报表").Compute("Sum(生产数)", "本工序 = '" & e.DataRow("本工序") & "' And 规格型号 = '" & e.DataRow("规格型号") & "'") e.DataRow("生产数") = sum End If End Select