-- [求助]统计表删除空行
老师好,下面统计时有多余的空行想删除。
If e.DataCol.name = "年份" OrElse e.DataCol.name = "客户名称" Then
If e.DataRow.Isnull("年份") = False AndAlso e.DataRow.Isnull("客户名称") = False Then
Dim filter1 As String = "客户 = \'" & e.DataRow("客户名称") & "\'"
Dim filter2 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(出库_价税合计)", filter1 & " and 出库日期 >= #" & d & "# and 出库日期 < #" & d.addmonths(1) & "#")
Dim sum1 As Integer = DataTables("入库明细").compute("sum(入库_合计金额)", filter2 & " and 入库日期 >= #" & d & "# and 入库日期 < #" & d.addmonths(1) & "#")
\'e.DataRow("M" & i) = sum
e.DataRow("M" & i) = sum + sum1
Next
Else
For i As Integer = 1 To 12
e.DataRow("M" & i) = Nothing
Next
End If
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