以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 完善一下交叉统计 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=176464) |
||||
-- 作者:刘效功 -- 发布时间:2022/4/14 11:21:00 -- 完善一下交叉统计 请实现如下功能,1 在窗口中实现交叉统计数据 2 增设一个下来列表按钮,选择垂直分组的显示 具体在附件中有详细说明
|
||||
-- 作者:有点蓝 -- 发布时间:2022/4/14 12:02:00 -- \'生成统计表代码 Dim dtb As New DataTableBuilder("统计表123") dtb.AddDef("立面分格信息1", Gettype(String), 32) Dim prds As List(of String) = DataTables("幕墙面材汇总表").GetValues("平面分格信息1") For Each prd As String In prds dtb.AddDef(prd & "_区域分组_平面分组", Gettype(String),32) dtb.AddDef(prd & "_区域分组_立面分组", Gettype(String),32) Next dtb.Build() \'以上是生成临时表格式的代码,测试完成,已经调试好 For Each cus As String In DataTables("幕墙面材汇总表").GetValues("立面分格信息1") Dim dr As DataRow = DataTables("统计表123").AddNew() dr("立面分格信息1") = cus For Each prd As String In prds Dim A1s As List (Of String) A1s= DataTables("幕墙面材汇总表").GetValues("幕墙部位分组1","安装位置2= \'" & cus & "\' And [安装位置1] = \'" & prd & "\'") For Each A1 As String In A1s dr(prd & "_区域分组_平面分组") =A1 Next Dim A2s As List (Of String) A2s= DataTables("幕墙面材汇总表").GetValues("幕墙部位分组2","安装位置2= \'" & cus & "\' And [安装位置1] = \'" & prd & "\'") For Each A2 As String In A2s dr(prd & "_区域分组_立面分组") =A2 Next Next Next \'MainTable= Tables("统计123") ’在临时表中测试没问题’ Tables("统计(测试在窗口中显示)_Table1").DataSource =datatable("统计表123") ‘设置窗口中显示 至于下拉,可以遍历表格所有列,把列名放到下拉框里供选择,没有选择的列都隐藏掉即可
|