Dim t As Table = Tables("窗口1_Table1")
t.StopRedraw
Dim g As New CrossTableBuilder("统计表1", DataTables("b"))
g.HGroups.AddDef("订单号")
g.VGroups.AddDef("加工工艺")
g.Totals.AddDef("数量")
g.HorizontalTotal = True
t.DataSource =g.BuildDataSource()
t.DataTable.DataCols.Add("颜色",Gettype(String))
t.Cols("颜色").Move(1)
For Each r As Row In t.Rows
r("颜色") = DataTables("b").GetComboListString("颜色","订单号='" & r("订单号") & "'").replace("|",",")
Next
For Each c As Col In t.Cols
If c.name.StartsWith("数量_") Then
c.Caption = "已" & c.Caption & "数量"
End If
Next
t.Cols("合计").Caption = "订单数量"
t.DataTable.BuildHeader()
t.AutoSizeCols
t.ResumeRedraw