Foxtable(狐表)用户栏目专家坐堂 → 怎么在这个的基础上按照序号来分段显示一个小计


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

主题:怎么在这个的基础上按照序号来分段显示一个小计

帅哥哟,离线,有人找我吗?
wujie
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:51 积分:494 威望:0 精华:0 注册:2020/2/21 10:32:00
怎么在这个的基础上按照序号来分段显示一个小计  发帖心情 Post By:2020/6/30 13:55:00 [显示全部帖子]

Dim d1 As Date = e.Form.Controls("B").Value
Dim d2 As Date = e.Form.Controls("C").Value
Dim s As String = e.Form.Controls("A").Value
Dim cmb As WinForm.ComboBox = e.form.Controls("ComboBox1")
If d1 = Nothing Or d2 = Nothing Then
    MessageBox.Show("日期都不能为空","友情提醒",MessageBoxButtons.OK,MessageBoxIcon.Warning)
Else
    With DataTables("生产记录")
        .LoadFilter = "日期>=#" & d1 & "# and 日期<=#" & d2 & "# and 配方名称 = '" & s & "'"
        .Load()
    End With
 Dim b As New GroupTableBuilder("统计表5",DataTables("生产记录"))
     b.Groups.AddDef("原料名称")
     b.Groups.AddDef("序号")
     b.Build  
     MainTable = Tables("统计表5")
     cmb.ComboList = DataTables("统计表5").GetComboListString("序号")
End If

Dim mb As WinForm.ComboBox
mb = Forms("窗口2").Controls("ComboBox1")
e.form.controls("D").text = mb.ComboList.split("|").length


Dim d11 As Date = e.Form.Controls("B").Value
Dim d12 As Date = e.Form.Controls("C").Value
Dim s1 As String = e.Form.Controls("A").Value
 If d1 = Nothing Or d2 = Nothing Then
    MessageBox.Show("日期都不能为空","友情提醒",MessageBoxButtons.OK,MessageBoxIcon.Warning)
Else

   With DataTables("生产记录")
        .LoadFilter = "日期>=#" & d11 & "# and 日期<=#" & d12 & "# and 配方名称 = '" & s1 & "'"
        .Load()
    End With
 Dim b1 As New GroupTableBuilder("统计表3",DataTables("生产记录"))
     b1.Groups.AddDef("日期")

     b1.Groups.AddDef("配方名称")
     b1.Groups.AddDef("原料名称")
     b1.Groups.AddDef("设定值")
     b1.Groups.AddDef("实际值")
     b1.Groups.AddDef("误差值")
     b1.Groups.AddDef("序号")


     b1.Build  
     MainTable = Tables("统计表3")
  '   Tables("窗口2_Table1").DataSource = b1.BuildDataSource()

End If

 回到顶部
帅哥哟,离线,有人找我吗?
wujie
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:51 积分:494 威望:0 精华:0 注册:2020/2/21 10:32:00
这个分出来了,但是没有统计数字  发帖心情 Post By:2020/6/30 14:11:00 [显示全部帖子]

Dim d1 As Date = e.Form.Controls("B").Value
Dim d2 As Date = e.Form.Controls("C").Value
Dim s As String = e.Form.Controls("A").Value
Dim cmb As WinForm.ComboBox = e.form.Controls("ComboBox1")
If d1 = Nothing Or d2 = Nothing Then
    MessageBox.Show("日期都不能为空","友情提醒",MessageBoxButtons.OK,MessageBoxIcon.Warning)
Else
    With DataTables("生产记录")
        .LoadFilter = "日期>=#" & d1 & "# and 日期<=#" & d2 & "# and 配方名称 = '" & s & "'"
        .Load()
    End With
 Dim b As New GroupTableBuilder("统计表5",DataTables("生产记录"))
     b.Groups.AddDef("原料名称")
     b.Groups.AddDef("序号")
     b.Build  
     MainTable = Tables("统计表5")
     cmb.ComboList = DataTables("统计表5").GetComboListString("序号")
End If

Dim mb As WinForm.ComboBox
mb = Forms("窗口2").Controls("ComboBox1")
e.form.controls("D").text = mb.ComboList.split("|").length


Dim d11 As Date = e.Form.Controls("B").Value
Dim d12 As Date = e.Form.Controls("C").Value
Dim s1 As String = e.Form.Controls("A").Value
 If d1 = Nothing Or d2 = Nothing Then
    MessageBox.Show("日期都不能为空","友情提醒",MessageBoxButtons.OK,MessageBoxIcon.Warning)
Else

   With DataTables("生产记录")
        .LoadFilter = "日期>=#" & d11 & "# and 日期<=#" & d12 & "# and 配方名称 = '" & s1 & "'"
        .Load()
    End With
 Dim b1 As New GroupTableBuilder("统计表3",DataTables("生产记录"))
     b1.Groups.AddDef("日期")

     b1.Groups.AddDef("配方名称")
     b1.Groups.AddDef("原料名称")
     b1.Groups.AddDef("设定值")
     b1.Groups.AddDef("实际值")
     b1.Groups.AddDef("误差值")
     b1.Groups.AddDef("序号")


     b1.Build  
     MainTable = Tables("统计表3")
  '   Tables("窗口2_Table1").DataSource = b1.BuildDataSource()

End If


Dim g As New Subtotalgroup 
g.GroupOn = "序号" 
g.TotalOn = "设定值,实际值,误差值" 
With Tables("生产记录")
    .SubtotalGroups.Clear() 
    .SubtotalGroups.Add(g) 
    .Subtotal() '生成汇总模式
End With

 回到顶部
帅哥哟,离线,有人找我吗?
wujie
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:51 积分:494 威望:0 精华:0 注册:2020/2/21 10:32:00
显示这个错误代码  发帖心情 Post By:2020/6/30 14:30:00 [显示全部帖子]

Invalid value for AggregateEnum parameter
参数名:Agg Type

 回到顶部