Dim Arys As List(Of String())
Arys = DataTables("表A").GetValues("类别|品名|规格")
For Each Ary As String() In Arys
dim dr as datarow = DataTables("表B").find("类别='" & Ary(0) & "' and 品名='" & Ary(1) & "' and 规格='" & Ary(2) & "'")if dr isnot nothing
dr("数量") = DataTables("表A").Compute("类别='" & Ary(0) & "' and 品名='" & Ary(1) & "' and 规格='" & Ary(2) & "'")
end if
Next
Dim Arys As List(Of String())
Arys = DataTables("表AA").GetValues("类别|品名|规格")
For Each Ary As String() In Arys
Dim dr As DataRow = DataTables("表BB").find("类别='" & Ary(0) & "' and 品名='" & Ary(1) & "' and 规格='" & Ary(2) & "'")
If dr("类别") = '大类' AndAlso dr("品名") IsNot Nothing Then
dr("数量") = DataTables("表AA").Compute("sum(数量)", "类别='" & Ary(0) & "' and 品名='" & Ary(1) & "'")
End If
If dr IsNot Nothing Then
dr("数量") = DataTables("表AA").Compute("sum(数量)", "类别='" & Ary(0) & "' and 品名='" & Ary(1) & "' and 规格='" & Ary(2) & "'")
End If
Next
执行大类没统计,加上红代码也不行,如何解决?