Foxtable(狐表)用户栏目专家坐堂 → 打开窗口提示找不到列[古今],双击提示列名‘古今’无效


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

主题:打开窗口提示找不到列[古今],双击提示列名‘古今’无效

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


加好友 发短信
等级:四尾狐 帖子:858 积分:6381 威望:0 精华:0 注册:2017/2/13 9:04:00
打开窗口提示找不到列[古今],双击提示列名‘古今’无效  发帖心情 Post By:2018/7/13 14:24:00 [只看该作者]


款号登记表:



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



窗口


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


AfterLoad


'首先生成统计表
Dim dt As DataTable
Dim b As New SQLGroupTableBuilder("统计表1","款号登记")
b.Con nection Name= "Lucifer" 
b.Groups.AddDef("品牌") 
b.Groups.AddDef("年份季度") 
b.Groups.AddDef("款类") 
b.Totals.AddDef("_Identify",AggregateEnum.Count,"款式数量") 
dt = b.Build(False) '参数设置为False,生成一个临时表,不在主界面显示
'然后根据统计表生成目录树
Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
trv.BuildTree(dt, "品牌|年份季度|款类")
trv.StopRedraw
For Each nd As WinForm.TreeNode In trv.AllNodes
      Dim pp As String = nd.DataRow("品牌")
      Dim nj As String = nd.DataRow("年份季度")
      Dim Product As String = nd.DataRow("款类")
    Select Case nd.Level
        Case 0
            nd.Text = nd.text & "(" & dt.Compute("Sum(订单数)","品牌 = " & pp) & "条)"
        Case 1
            nd.Text = nd.text & "(" & dt.Compute("Sum(订单数)","年份季度 = " & nj) & "条)"
        Case 2
            nd.Text = nd.text & "(" & nd.DataRow("订单数") & ")"
    End Select
Next
trv.Nodes.Insert("加载所有行","加载所有行(" & dt.Compute("Sum(订单数)") & "条)",0)
trv.ResumeRedraw

TreeView1    NodeMouseDoubleClick

Dim Filter As String = ""
If e.Node.Name <> "加载所有行" Then '要用Name属性,不能用Text属性
      Dim pp As String = e.Node.DataRow("品牌")
      Dim nj As String = e.Node.DataRow("年份季度")
      Dim Product As String = e.Node.DataRow("款类")
    Select Case e.Node.Level
        Case 0
            Filter ="品牌 = " & pp
        Case 1
            Filter ="品牌 = " & pp & " And 年份季节 = " & nj
        Case 2
            Filter ="品牌 = " & pp & " And 年份季度 = " & nj & " And 款类 = '" & Product & "'"
    End Select
End If
DataTables("款号登记").LoadFilter = Filter
DataTables("款号登记").Load()
[此贴子已经被作者于2018/7/13 16:11:13编辑过]

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/7/13 16:20:00 [只看该作者]

AfterLoad


'首先生成统计表
Dim dt As DataTable
Dim b As New SQLGroupTableBuilder("统计表1","款号登记")
b.Con nection Name= "Lucifer" 
b.Groups.AddDef("品牌") 
b.Groups.AddDef("年份季度") 
b.Groups.AddDef("款类") 
b.Totals.AddDef("_Identify",AggregateEnum.Count,"款式数量") 
dt = b.Build(False) '参数设置为False,生成一个临时表,不在主界面显示
'然后根据统计表生成目录树
Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
trv.BuildTree(dt, "品牌|年份季度|款类")
trv.StopRedraw
For Each nd As WinForm.TreeNode In trv.AllNodes
      Dim pp As String = nd.DataRow("品牌")
      Dim nj As String = nd.DataRow("年份季度")
      Dim Product As String = nd.DataRow("款类")
    Select Case nd.Level
        Case 0
            nd.Text = nd.text & "(" & dt.Compute("Sum(订单数)","品牌 = '" & pp & "'") & "条)"
        Case 1
            nd.Text = nd.text & "(" & dt.Compute("Sum(订单数)","年份季度 = '" & nj & "'") & "条)"
        Case 2
            nd.Text = nd.text & "(" & nd.DataRow("订单数") & ")"
    End Select
Next
trv.Nodes.Insert("加载所有行","加载所有行(" & dt.Compute("Sum(订单数)") & "条)",0)
trv.ResumeRedraw

TreeView1    NodeMouseDoubleClick

Dim Filter As String = ""
If e.Node.Name <> "加载所有行" Then '要用Name属性,不能用Text属性
      Dim pp As String = e.Node.DataRow("品牌")
      Dim nj As String = e.Node.DataRow("年份季度")
      Dim Product As String = e.Node.DataRow("款类")
    Select Case e.Node.Level
        Case 0
            Filter ="品牌 = '" & pp & "'"
        Case 1
            Filter ="品牌 = '" & pp & "' And 年份季节 = '" & nj & "'"
        Case 2
            Filter ="品牌 = '" & pp & "' And 年份季度 = '" & nj & "' And 款类 = '" & Product & "'"
    End Select
End If
DataTables("款号登记").LoadFilter = Filter
DataTables("款号登记").Load()

 回到顶部