Foxtable(狐表)用户栏目专家坐堂 → 关于加载后统计问题


  共有3346人关注过本帖树形打印复制链接

主题:关于加载后统计问题

帅哥,在线噢!
有点蓝
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110574 积分:562760 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2021/5/5 14:58:00 [显示全部帖子]

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(",","','") & "')"
Dim b As New GroupTableBuilder("统计表1",DataTables("订单"))
b.Groups.AddDef("产品")
b.Totals.AddDef("数量","订购数量") '添加数量列用于统计
b.Filter = Filter
Tables("分组加载统计_Table1").DataSource = b.BuildDataSource()

 回到顶部