以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  SQLGroupTableBuilder  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=193483)

--  作者:1234567
--  发布时间:2024/9/19 13:32:00
--  SQLGroupTableBuilder
Dim b As New SQLGroupTableBuilder("统计表1", "订单")
b.C
b.AddTable("订单", "产品ID", "产品", "产品ID") \'添加统计表
b.Groups.AddDef("产品ID") \' 如何才能根据产品ID分组?
b.Totals.AddDef("数量") \'对数量进行统计
b.Build \'生成统计表
Maintable = Tables("统计表1") \'打开生成的统计表

图片点击可在新窗口打开查看此主题相关图片如下:5.png
图片点击可在新窗口打开查看

--  作者:有点蓝
--  发布时间:2024/9/19 13:34:00
--  
http://www.foxtable.com/webhelp/topics/3299.htm
--  作者:1234567
--  发布时间:2024/9/19 14:17:00
--  
 

Dim b As New SQLGroupTableBuilder("统计表1","订单")
b.ConnectionName =
"Sale"
b.AddTable(
"订单","产品ID","产品","产品ID") \'添加统计表
b.Groups.AddDef(
"产品名称") \'根据产品名称分组
b.Groups.AddDef(
"日期", DateGroupEnum.Year, "年") \'根据日期按年分组
b.Totals.AddDef(
"数量") \'对数量进行统计
b.Build
\'生成统计表
Maintable
= Tables("统计表1") \'打开生成的统计表

 

 

如何把"统计表1"移入到窗口中Table控件?


--  作者:1234567
--  发布时间:2024/9/19 14:55:00
--  

Dim Filter As String
Dim txt1 As String = e.Form.Controls("DropBox1").Text
Dim txt2 As String = e.Form.Controls("DropBox2").Text
Dim txt3 As String = e.Form.Controls("DropBox3").Text
Dim txt4 As String = e.Form.Controls("DropBox4").Text
Dim txt5 As String = e.Form.Controls("DropBox5").Text
Dim b As New SQLGroupTableBuilder("标准工艺库", "工艺内容")
b.AddTable("工艺内容", "工艺单编号", "零件加工", "工艺单编号")
b.C
b.Groups.AddDef("{零件加工}.工艺单编号") \'根据订单表产品ID分组
b.Totals.AddDef("是否定为标准工艺")
Filter = "是否定为标准工艺 = True"

If txt1 <> "" Then
    b.Totals.AddExp(txt1, "iif(工序=\'" & txt1 & "\' ,1,0)")
    Tables("工艺库_Table03").SetColVisibleWidth("工艺单编号|70|是否定为标准工艺|70|" & txt1 & "|100")  能生成
 
   If Filter > "" Then
        Filter = Filter & " And "
    End If
    Filter = Filter & txt1 & "> 0"
End If

If txt2 <> "" Then
    b.Totals.AddExp(txt2, "iif(工序=\'" & txt2 & "\' ,1,0)")
    Tables("工艺库_Table03").SetColVisibleWidth("工艺单编号|70|是否定为标准工艺|70|" & txt1 & "|100|" & txt2 & "|100")     不能生成
    If Filter > "" Then
        Filter = Filter & " And "
    End If
    Filter = Filter & txt2 & "> 0"
End If

If txt3 <> "" Then
    b.Totals.AddExp(txt3, "iif(工序=\'" & txt3 & "\' ,1,0)")
     Tables("工艺库_Table03").SetColVisibleWidth("工艺单编号|70|是否定为标准工艺|70|" & txt1 & "|100|" & txt2 & "|100|" & txt3 & "|100")
    If Filter > "" Then
        Filter = Filter & " And "
    End If
    Filter = Filter & txt3 & "> 0"
End If

If txt4 <> "" Then
    b.Totals.AddExp(txt4, "iif(工序=\'" & txt4 & "\' ,1,0)")
      Tables("工艺库_Table03").SetColVisibleWidth("工艺单编号|70|是否定为标准工艺|70|" & txt1 & "|100|" & txt2 & "|100|" & txt3 & "|100|" & txt4 & "|100")
    If Filter > "" Then
        Filter = Filter & " And "
    End If
    Filter = Filter & txt4 & "> 0"
End If

If txt5 <> "" Then
    b.Totals.AddExp(txt5, "iif(工序=\'" & txt5 & "\' ,1,0)")
    Tables("工艺库_Table03").SetColVisibleWidth("工艺单编号|70|是否定为标准工艺|70|" & txt1 & "|100|" & txt2 & "|100|" & txt3 & "|100|" & txt4 & "|100|" & txt5 & "|100")
    If Filter > "" Then
        Filter = Filter & " And "
    End If
    Filter = Filter & txt5 & "> 0"
End If

b.Build
If Filter > "" Then
    Tables("工艺库_TABLE03").Filter = Filter    不能Filter
End If


--  作者:有点蓝
--  发布时间:2024/9/19 15:20:00
--  
http://www.foxtable.com/webhelp/topics/1909.htm

需要绑定窗口表后,对表格的各种设置才有效

--  作者:1234567
--  发布时间:2024/9/19 16:00:00
--  
Dim Filter As String
Dim txt1 As String = e.Form.Controls("DropBox1").Text
Dim txt2 As String = e.Form.Controls("DropBox2").Text
Dim txt3 As String = e.Form.Controls("DropBox3").Text
Dim txt4 As String = e.Form.Controls("DropBox4").Text
Dim txt5 As String = e.Form.Controls("DropBox5").Text
Dim b As New SQLGroupTableBuilder("标准工艺库", "工艺内容")
b.AddTable("工艺内容", "工艺单编号", "零件加工", "工艺单编号")
b.C
b.Groups.AddDef("{零件加工}.工艺单编号") \'根据订单表产品ID分组
Tables("工艺库_Table03").DataSource = b.BuildDataSource()   加了这句后后出错
b.Totals.AddDef("是否定为标准工艺")
Filter = "是否定为标准工艺 = True"

--  作者:1234567
--  发布时间:2024/9/19 16:01:00
--  

图片点击可在新窗口打开查看此主题相关图片如下:8.png
图片点击可在新窗口打开查看

--  作者:有点蓝
--  发布时间:2024/9/19 16:52:00
--  
请上传实例说明