Dim dtb As New DataTableBuilder("统计表4")
dtb.AddDef("乡镇", GetType(String), 16)
Dim prds As List(Of String()) = DataTables("表A").GetValues("检查年度|检查时间|检查结果")
For Each prd As String() In prds
'dtb.AddDef(prd(0) & "_" & prd(2), GetType(String), 16)
dtb.AddDef(prd(0) & "_" & prd(1) & "_" & prd(2), GetType(String), 16)
Next
dtb.Build()
For Each cus As String() In DataTables("表A").GetValues("乡镇")
Dim dr As DataRow = DataTables("统计表4").AddNew()
dr("乡镇") = cus(0)
For Each prd As String() In prds
'dr(prd(0) & "_" & prd(2)) = DataTables("表A").GetComboListString("村名", "乡镇 = '" & cus(0) & "' and 检查年度='" & prd(0) & "' and 检查时间='" & prd(1) & "'and 检查结果='" & prd(2) & "'")
dr(prd(0) & "_" & prd(1) & "_" & prd(2)) = DataTables("表A").GetComboListString("村名", "乡镇 = '" & cus(0) & "' and 检查年度='" & prd(0) & "' and 检查时间='" & prd(1) & "'and 检查结果='" & prd(2) & "'")
Next
Next
MainTable = Tables("统计表4")'打开生成的统计表
蓝老师,帮忙再看看上面代码哪里出错误了?