Table控件的类型根据需要设置为SQLTable:
tSelec * From {订单} Where [_Identify] Is Null
Dim y As Integer = Date.Today.Year
Dim dt1 As New Date(y, 1, 1)
Dim dt2 As New Date(y, 12, 31)
Dim Filter As String
Dim s As String = ""
Select Case User.Group
Case "录入者","",Nothing
s =user.name
Case Else
Dim dr2 As DataRow
dr2 = DataTables("用户").Find("[分组] = '" & User.Group & "'")
If dr2 IsNot Nothing Then
s = dr2("下级")
End If
End Select
Filter = "日期 >= #" & dt1 & "# And 日期 <= #" & dt2 & "# and 录入者 in ('" & s.replace(",","','") & "')"
DataTables("分组加载统计_Table1").LoadFilter = Filter
DataTables("分组加载统计_Table1").Load()
Dim Filter As String
Dim b As New GroupTableBuilder("统计表1",DataTables("订单"))
b.Groups.AddDef("产品")
b.Totals.AddDef("数量","订购数量") '添加数量列用于统计
b.Filter = Filter
Tables("分组加载统计_Table1").DataSource = b.BuildDataSource()