老师,下面代码统计不出数据。
If e.DataCol.name = "年份" OrElse e.DataCol.name = "客户名称" Then
If e.DataRow.Isnull("年份") = False AndAlso e.DataRow.Isnull("客户名称") = False Then
Dim filter As String = "客户 = '" & e.DataRow("客户名称") & "'"
For i As Integer = 1 To 12
Dim d As Date = new Date(val(e.DataRow("年份")), i, 1)
Dim sum As Integer = DataTables("出库明细").compute("sum(出库_价税合计)", filter & " and 出库日期 >= #" & d & "# and 出库日期 < #" & d.addmonths(1) & "#")
e.DataRow("M" & i) = sum
Next
Else
For i As Integer = 1 To 12
e.DataRow("M" & i) = Nothing
Next
End If
End If