Dim g As New GroupTableBuilder("统计表2", DataTables("订单"))
g.Groups.AddDef("产品")
g.Groups.AddDef("客户")
g.Totals.AddDef("数量")
Dim t As Table = Tables("窗口1_Table1")
t.DataSource = g.BuildDataSource()
t.Sort = "产品 ,数量 DESC"
Dim count As Integer = 0
For i As Integer = 0 To t.Rows.count - 1
If i > 0 AndAlso t.Rows(i)("产品") <> t.rows(i-1)("产品")
count = 1
Else
count += 1
If count > 2 Then
t.Rows(i)("_locked") = True
End If
End If
Next
t.filter = "_Locked is null"