Foxtable(狐表)用户栏目专家坐堂 → [求助]目录树统计提示找不到列


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

主题:[求助]目录树统计提示找不到列

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


加好友 发短信
等级:幼狐 帖子:185 积分:1192 威望:0 精华:0 注册:2020/8/20 14:33:00
[求助]目录树统计提示找不到列  发帖心情 Post By:2024/4/2 11:59:00 [只看该作者]

Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
trv.BuildTree(gt, "年|月|日|分类|部件")
trv.StopRedraw
For Each nd As WinForm.TreeNode In trv.AllNodes
    Dim Year As Integer = nd.DataRow("年")
    Dim Month As Integer = nd.DataRow("月")
    Dim Day As Integer = nd.DataRow("日")
    Dim type As String = nd.DataRow("分类")
    Dim component As String = nd.DataRow("部件")
    Select Case nd.Level
        Case 0
            nd.Text = nd.text & "年(" & gt.Compute("Sum(数量)", "年 = " & Year) & "个)"
        Case 1
            nd.Text = nd.text & "月(" & gt.Compute("Sum(数量)", "年 = " & Year & " And 月 = " & Month) & "个)"
        Case 2
            nd.Text = nd.text & "日(" & gt.Compute("Sum(数量)", "年 = " & Year & " And 月 = " & Month & " And 日 = " & Day) & "个)"
        Case 3
            nd.Text = nd.text & "日(" & gt.Compute("Sum(数量)", "年 = " & Year & " And 月 = " & Month & " And 日 = " & Day & " And 分类 = " & type) & "个)"
        Case 4
            nd.Text = nd.text & "(" & gt.Compute("Sum(数量)", "年 = " & Year & " And 月 = " & Month & " And 日 = " & Day) & "个)" 
    End Select
Next
trv.Nodes.Insert("[显示所有行]", "显示所有行(" & Val(gt.Compute("Sum(数量)")) & "个)", 0)
trv.ResumeRedraw

代码如上,点击case3的时候提示找不到列,前面1,2都可以,是case3的后面的条件写错了吗

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


加好友 发短信
等级:超级版主 帖子:110544 积分:562604 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2024/4/2 13:33:00 [只看该作者]

参考:http://www.foxtable.com/webhelp/topics/1284.htm

Case 3
            nd.Text = nd.text & "日(" & gt.Compute("Sum(数量)", "年 = " & Year & " And 月 = " & Month & " And 日 = " & Day & " And 分类 = '" & type & "'") & "个)"

 回到顶部