这代码排除了重复值,怎么还是显示重复值呢?DataTables("cpyb").DataRows.Clear
Dim f As New Filler
f.SourceTable = DataTables("cpmx")
f.DataTable = DataTables("cpyb")
f.ExcludeExistValue = True
f.Distinct = True '排除重复值
'f.Filter = "月份 = '" & s & "'"
f.Fill()
For Each dr As DataRow In DataTables("cpyb").DataRows
Dim s1 As String = "产品名称 = '" & dr("产品名称") & "'"
dr("入库数量") = DataTables("cpmx").Compute("Sum(入库数量)",s1)
dr("出库数量") = DataTables("cpmx").Compute("Sum(出库数量)",s1)
dr("当前库存") = dr("入库数量") - dr("出库数量")
Next
此主题相关图片如下:1.jpg