If Tables("订单表_Table1").DataTable.DataCols.Contains("明细品种") Then
Tables("订单表_Table1").Cols("明细品种").Visible = True
Else
Tables("订单表_Table1").DataTable.DataCols.Add("明细品种",Gettype(String),255)
End If
For Each r As Row In Tables("订单表_Table1").Rows
Dim Products As List(Of String)
Dim Parts() As String
Products = DataTables("cbb").GetValues("产品名称","[订单编号] = ' " & r("订单编号") & " '" )
Parts = products.ToArray()
Dim Str1 As String
Str1 = String.Join(" ", Parts)
r("明细品种") = Str1
Next
以上代码运行后只生成了临时列“明细品种",但是却没有赋值成功。
订单表_Table1 是副本,设置为不允许编辑。有关系吗?
因为我目的是明细品种列是临时用的。完成打印关闭窗口就没有了。
请指点,谢谢!