老师,下面代码怎样再加上2024年的月份统计。
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
Dim d As Double = DataTables("数据汇总").Compute("Sum(" & e.DataRow("项目") & "_应付)", Filter)
'msgbox("条件=" & Filter & ", 查询结果=" & d)
e.DataRow("M" & i) = d
Next
End If
Dim dr As DataRow = e.DataRow
Select Case e.DataCol.Name
Case "M1","M2","M3","M4","M5","M6","M7","M8","M9","M10","M11","M12"
If dr.IsNull("M1") OrElse dr.IsNull("M2") OrElse dr.IsNull("M3") OrElse dr.IsNull("M4") OrElse dr.IsNull("M5") OrElse dr.IsNull("M6") OrElse dr.IsNull("M7") OrElse dr.IsNull("M8") OrElse dr.IsNull("M9") OrElse dr.IsNull("M10") OrElse dr.IsNull("M11") OrElse dr.IsNull("M12") Then
dr("年度统计") = Nothing
Else
dr("年度统计") = dr("M1") + dr("M2") + dr("M3") + dr("M4") + dr("M5") + dr("M6") + dr("M7") + dr("M8") + dr("M9") + dr("M10") + dr("M11") + dr("M12")
End If
End Select