老师,下面代码只统计到9月份
If e.DataCol.Name = "项目ID" OrElse e.DataCol.Name = "项目" Then
For i As Integer = 1 To 12
Dim Filter As String = e.DataRow("项目") & "_ID = '" & e.DataRow("项目ID") & "' and 月=" & i
e.DataRow("M" & i) = DataTables("数据汇总").Compute("Sum(" & e.DataRow("项目") & "_应付)", Filter)
Next
End If
If e.DataCol.Name Like "*房_ID" Then
Dim pr As DataRow
pr = DataTables("水电气统计").Find("项目 = '" & e.DataCol.Name.split("_")(0) & "' and 项目ID='" & e.newvalue & "'")
If pr IsNot Nothing Then
DataTables("水电气统计").DataCols("项目ID").RaiseDataColChanged(pr)
End If
Else If e.DataCol.Name Like "*房_应付" Then
Dim pr As DataRow
pr = DataTables("水电气统计").Find("项目 = '" & e.DataCol.Name.split("_")(0) & "' and 项目ID='" & e.DataRow(e.DataCol.Name.split("_")(0) & "_ID") & "'")
If pr IsNot Nothing Then
DataTables("水电气统计").DataCols("项目ID").RaiseDataColChanged(pr)
End If
End If