以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  怎么实现用CLICK(代码),一键统计出像统计报表格式中的效果?  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=128262)

--  作者:soap_lwb
--  发布时间:2018/12/2 16:19:00
--  怎么实现用CLICK(代码),一键统计出像统计报表格式中的效果?
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:管理项目2.zip


--  作者:y2287958
--  发布时间:2018/12/2 16:56:00
--  
Dim tjb As String = "统计表1"
Dim b As New SQLGroupTableBuilder(tjb,"表A")
b.Groups.AddExp("日期","CDate(日期)")
b.Totals.AddExp("表A_接单量","1")
b.Totals.AddExp("表A_已处理数量","iif(是否解决=true,1,0)")
b.Totals.AddExp("表A_未处理数量","iif(是否解决=true,0,1)")
\'b.Build
Dim d As fxDataSource = b.BuildDataSource()
Dim bms As String = "表B|表C|表D"
For Each bm As String In bms.split("|")
    Dim b1 As New SQLGroupTableBuilder(tjb,bm)
    b1.Groups.AddExp("日期","CDate(日期)")
    b1.Totals.AddExp(bm & "_接单量","1")
    b1.Totals.AddExp(bm & "_已处理数量","iif(是否解决=true,1,0)")
    b1.Totals.AddExp(bm & "_未处理数量","iif(是否解决=true,0,1)")
    \'b1.Build
    Dim d1 As fxDataSource = b1.BuildDataSource()
    d.Combine("日期",d1,"日期")
Next
d.Show(tjb)
MainTable = Tables(tjb) \'打开生成的统计表"

--  作者:soap_lwb
--  发布时间:2018/12/2 17:52:00
--  
谢谢,但如果要在窗口中指定要输出的时间段的内容报表,又当如何编辑?

如问题:http://www.foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=128264&replyID=&skin=1

--  作者:有点甜
--  发布时间:2018/12/2 21:10:00
--  

加上红色代码,如

 

Dim tjb As String = "统计表1"
Dim b As New SQLGroupTableBuilder(tjb,"表A")
b.Groups.AddExp("日期","CDate(日期)")
b.Totals.AddExp("表A_接单量","1")
b.Totals.AddExp("表A_已处理数量","iif(是否解决=true,1,0)")
b.Totals.AddExp("表A_未处理数量","iif(是否解决=true,0,1)")
Dim dd As Date = "2018-10-01"
b.filter = "日期>=#" & dd & "# and 日期 < #" & dd.addmonths(1) & "#"

\'b.Build
Dim d As fxDataSource = b.BuildDataSource()
Dim bms As String = "表B|表C|表D"
For Each bm As String In bms.split("|")
    Dim b1 As New SQLGroupTableBuilder(tjb,bm)
    b1.Groups.AddExp("日期","CDate(日期)")
    b1.Totals.AddExp(bm & "_接单量","1")
    b1.Totals.AddExp(bm & "_已处理数量","iif(是否解决=true,1,0)")
    b1.Totals.AddExp(bm & "_未处理数量","iif(是否解决=true,0,1)")
    b.filter = "日期>=#" & dd & "# and 日期 < #" & dd.addmonths(1) & "#"
    \'b1.Build
    Dim d1 As fxDataSource = b1.BuildDataSource()
    d.Combine("日期",d1,"日期")
Next
d.Show(tjb)
MainTable = Tables(tjb) \'打开生成的统计表"


--  作者:soap_lwb
--  发布时间:2018/12/3 10:54:00
--  
老师,非常感谢,最后再帮看看http://www.foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=128281&replyID=&skin=1