Dim g As New CrossTableBuilder("统计表1", DataTables("订单"))
g.HGroups.AddDef("产品")
g.VGroups.AddDef("客户", "客户_{0}")
g.Totals.AddDef("数量", "数量")
g.Totals.AddDef("雇员",AggregateEnum.Count, "雇员")
g.Build()
MainTable = Tables("统计表1")
Dim dict As new Dictionary(of String, String)
For Each c As Col In Tables("统计表1").Cols
If c.Caption Like "*雇员" Then
dict.Add(c.Name,c.Caption.Split("_")(1))
End If
Next
For Each r As Row In Tables("统计表1").Rows
For Each key As String In dict.Keys
r(key) = DataTables("订单").GetValues("雇员","产品='" & r("产品") & "' And 客户='" & dict(key) & "'").count
Next
Next