DataColChanged事件
Select Case e.DataCol.Name
Case "日期","逆变器_ST20K17000631","逆变器_ST5017000384"
Dim d2 As Date = e.DataRow("日期")
Dim d1 = new Date(d2.Year, d2.Month, 1)
Dim d3 As Date = new Date(d2.Year, 1, 1)
Dim filter1 As String = "日期 >= #" & d1 & "# and 日期 <= #" & d2 & "#"
Dim filter2 As String = "日期 >= #" & d3 & "# and 日期 <= #" & d2 & "#"
e.DataRow("发电量_月发电量") = e.DataTable.Compute("sum(发电量_日发电量)", filter1)
e.DataRow("发电量_年发电量") = e.DataTable.Compute("sum(发电量_日发电量)", filter2)
End Select