以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [求助]节点统计数量 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=162123) |
-- 作者:2425004926 -- 发布时间:2021/4/6 16:18:00 -- [求助]节点统计数量 目录节点增加数量统计,这里 sz2(0)是数组的第一个值,sz2(1)是数组的第二个值,统计时出错,在[]括号里是否不能这样表达? 这个是二级节点 nd.Text = nd.text & "(" & dt.Compute("Sum(数量)","[sz2(0)] = \'" & ly & "\' And [sz2(1)] = \'" & sq & "\'") & ")" 如果这样表达可以nd.Text = nd.text & "(" & dt.Compute("Sum(数量)", filter") & ")" 那么dim filter as string = ??? 该怎么写?
|
-- 作者:2425004926 -- 发布时间:2021/4/6 16:35:00 -- 我的目的是想让目录更加智能化一些,目录显示是没有问题,只在统计上出错 Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1") trv.BuildTree(dt, xt) Dim sz2() As String = xt.split("|") \'选定的目录里有几列 For Each nd As WinForm.TreeNode In trv.AllNodesSelect Case nd.Level Case 0 Dim ly As String = nd.text Dim filter As String = "[" & sz2(0) & "]" & "=" & ly \'nd.Text = nd.text & "(" & dt.Compute("Sum(数量)","[sz2(0)] = \'" & ly & "\'") & ")" nd.Text = nd.text & "(" & dt.Compute("Sum(数量)",filter) & ")" Case 1 Dim sq As String = nd.text Dim gs As Integer = nd.ParentNode.text.LastIndexOf("(") Dim ly As String = nd.ParentNode.text.SubString(0,gs) \'nd.Text = nd.text & "(" & dt.Compute("Sum(数量)","[sz2(0)] = \'" & ly & "\' And [sz2(1)] = \'" & sq & "\'") & ")" End Select Next |
-- 作者:有点蓝 -- 发布时间:2021/4/6 16:48:00 -- nd.Text = nd.text & "(" & dt.Compute("Sum(数量)", "[" & sz2(0) & "] = \'" & ly & "\' And [" & sz2(1) & "] = \'" & sq & "\'") & ")" |
-- 作者:2425004926 -- 发布时间:2021/4/6 16:58:00 -- 太好了!谢谢!谢谢! |