以文本方式查看主题
- Foxtable(狐表) (http://foxtable.net/bbs/index.asp)
-- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2)
---- 筛选树 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=129108)
|
-- 作者:宁老师SQE
-- 发布时间:2018/12/21 16:02:00
-- 筛选树
Dim dt As DataTable Dim b As New GroupTableBuilder("统计表1",DataTables("产品订单管理")) b.Groups.AddDef("客户名称") b.Groups.AddDef("产品代号") b.Totals.AddDef("订单关闭",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 Producta As String = nd.DataRow("客户名称") Dim Productb As String = nd.DataRow("产品代号") Dim Product As Byte = nd.DataRow("订单关闭") Select Case nd.Level Case 0 nd.Text = nd.text & "客户名称(" & dt.Compute("Sum(订单数)","客户名称 = " & Producta) & "条)" Case 1 nd.Text = nd.text & "产品代号(" & dt.Compute("Sum(订单数)","客户名称 = " & Producta & " And 产品代号 = " & Productb) & "条)" Case 2 nd.Text = nd.text & "(" & nd.DataRow("订单数") & "条)" End Select Next trv.Nodes.Insert("显示所有行","显示所有行(" & dt.Compute("Sum(订单数)") & "条)",0) trv.ResumeRedraw 此主题相关图片如下:360截图16530715525641.png
有这个列名为什么还是无效的呢,判断列不能做筛选树吗
|
-- 作者:有点甜
-- 发布时间:2018/12/21 16:08:00
--
Dim dt As DataTable Dim b As New GroupTableBuilder("统计表1",DataTables("产品订单管理")) b.Groups.AddDef("客户名称") b.Groups.AddDef("产品代号") b.Totals.AddDef("订单关闭",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 Producta As String = "\'" & nd.DataRow("客户名称") & "\'" Dim Productb As String = "\'" & nd.DataRow("产品代号") & "\'" Dim Product As String = "\'" & nd.DataRow("订单关闭") & "\'" Select Case nd.Level Case 0 nd.Text = nd.text & "客户名称(" & dt.Compute("Sum(订单数)","客户名称 = " & Producta) & "条)" Case 1 nd.Text = nd.text & "产品代号(" & dt.Compute("Sum(订单数)","客户名称 = " & Producta & " And 产品代号 = " & Productb) & "条)" Case 2 nd.Text = nd.text & "(" & nd.DataRow("订单数") & "条)" End Select Next trv.Nodes.Insert("显示所有行","显示所有行(" & dt.Compute("Sum(订单数)") & "条)",0) trv.ResumeRedraw
|
-- 作者:宁老师SQE
-- 发布时间:2018/12/21 16:56:00
--
此主题相关图片如下:360截图16530715525641.png
复制进去怎么都报错了
|
-- 作者:宁老师SQE
-- 发布时间:2018/12/21 16:58:00
-- 复制进去怎么全报错了呢
此主题相关图片如下:360截图1648030582104102.png
此主题相关图片如下:360截图16800409362741.png
复制进去怎么全报错了呢
[此贴子已经被作者于2018/12/21 16:58:49编辑过]
|
-- 作者:有点甜
-- 发布时间:2018/12/21 17:00:00
--
Dim page As WinForm.TopicPage page = Forms("导航栏").Controls("TopicBar1").pages("项目流程跟踪") Dim lnk As WinForm.TopicLink = page.Links("未完成立项") Dim cnt As Byte = DataTables("报价阶段表").Compute("count([_identify])"," 是否立项 = False ") lnk.Text = lnk.Text & "(" & cnt & ")"
Dim pagea As WinForm.TopicPage pagea = Forms("导航栏").Controls("TopicBar1").pages("项目流程跟踪") Dim lnka As WinForm.TopicLink = pagea.Links("未选择供应商") Dim cnta As Byte = DataTables("报价阶段表").Compute("count([_identify])"," 是否立项 = true And 参与报价 = False ") lnka.Text = lnka.Text & "(" & cnta & ")"
Dim pageb As WinForm.TopicPage pageb = Forms("导航栏").Controls("TopicBar1").pages("项目流程跟踪") Dim lnkb As WinForm.TopicLink = pageb.Links("未提交反馈") Dim cntb As Byte = DataTables("报价阶段表").Compute("count([_identify])"," 是否立项 = true And 参与报价 = true And 提交反馈 = False ") lnkb.Text = lnkb.Text & "(" & cntb & ")"
Dim paged As WinForm.TopicPage paged = Forms("导航栏").Controls("TopicBar1").pages("项目流程跟踪") Dim lnkd As WinForm.TopicLink = paged.Links("总经理未确认") Dim cntd As Byte = DataTables("报价阶段表").Compute("count([_identify])"," 是否立项 = true And 参与报价 = true And 提交反馈 = true And 总经理确认 = False") lnkd.Text = lnkd.Text & "(" & cntd & ")"
Dim pagee As WinForm.TopicPage pagee = Forms("导航栏").Controls("TopicBar1").pages("项目流程跟踪") Dim lnke As WinForm.TopicLink = pagee.Links("客户未最终确认") Dim cnte As Byte = DataTables("报价阶段表").Compute("count([_identify])"," 是否立项 = true And 参与报价 = true And 提交反馈 = true And 总经理确认 = true And 最终确认 = False") lnke.Text = lnke.Text & "(" & cnte & ")"
Dim pagef As WinForm.TopicPage pagef = Forms("导航栏").Controls("TopicBar1").pages("项目流程跟踪") Dim lnkf As WinForm.TopicLink = pagef.Links("未完成报价") Dim cntf As Byte = DataTables("报价阶段表").Compute("count([_identify])"," 是否立项 = true And 参与报价 = true And 提交反馈 = true And 总经理确认 = true And 最终确认 = true And 报价结束 = False") lnkf.Text = lnkf.Text & "(" & cntf & ")"
lnk = page.Links("七天内到截止日期") cnt = DataTables("报价阶段表").Compute("count([_identify])","项目截止时间<=#" & Date.Today.adddays(7) & "#") lnk.Text = lnk.Text & "(" & cnt & ")"
lnk = page.Links("三天内到截止日期") cnt = DataTables("报价阶段表").Compute("count([_identify])","项目截止时间<=#" & Date.Today.adddays(3) & "#") lnk.Text = lnk.Text & "(" & cnt & ")"
Dim pageg As WinForm.TopicPage Dim nms() As String = {"客户名称" ,"报价_供应商" , "项目经理"} For Each nm As String In nms pageg = Forms("导航栏").Controls("TopicBar1").pages(nm) For Each pd As String In DataTables("报价阶段表").GetValues(nm) Dim lnkg As WinForm.TopicLink = pageg.Links.Add(pd ,pd) Dim cntg As Integer = DataTables("报价阶段表").Compute("count([_identify])", nm & "=\'" & pd & "\'") lnkg.Text = lnkg.Text & "(" & cntg & ")" Next Next
Dim dt As DataTable Dim b As New GroupTableBuilder("统计表1",DataTables("产品订单管理")) b.Groups.AddDef("客户名称") b.Groups.AddDef("产品代号") b.Totals.AddDef("订单关闭",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 Producta As String = "\'" & nd.DataRow("客户名称") & "\'" Dim Productb As String = "\'" & nd.DataRow("产品代号") & "\'" Select Case nd.Level Case 0 nd.Text = nd.text & "客户名称(" & dt.Compute("Sum(订单数)","客户名称 = " & Producta) & "条)" Case 1 nd.Text = nd.text & "产品代号(" & dt.Compute("Sum(订单数)","客户名称 = " & Producta & " And 产品代号 = " & Productb) & "条)" Case 2 nd.Text = nd.text & "(" & nd.DataRow("订单数") & "条)" End Select Next trv.Nodes.Insert("显示所有行","显示所有行(" & dt.Compute("Sum(订单数)") & "条)",0) trv.ResumeRedraw
|
-- 作者:宁老师SQE
-- 发布时间:2018/12/21 18:02:00
--
这样只能筛选树列出所有的订单数量 但是我想要达到的目的 我想要是筛选树把完成的和未完成的分开 这样方便筛选
|
-- 作者:有点甜
-- 发布时间:2018/12/21 18:06:00
--
Dim page As WinForm.TopicPage page = Forms("导航栏").Controls("TopicBar1").pages("项目流程跟踪") Dim lnk As WinForm.TopicLink = page.Links("未完成立项") Dim cnt As Byte = DataTables("报价阶段表").Compute("count([_identify])"," 是否立项 = False ") lnk.Text = lnk.Text & "(" & cnt & ")"
Dim pagea As WinForm.TopicPage pagea = Forms("导航栏").Controls("TopicBar1").pages("项目流程跟踪") Dim lnka As WinForm.TopicLink = pagea.Links("未选择供应商") Dim cnta As Byte = DataTables("报价阶段表").Compute("count([_identify])"," 是否立项 = true And 参与报价 = False ") lnka.Text = lnka.Text & "(" & cnta & ")"
Dim pageb As WinForm.TopicPage pageb = Forms("导航栏").Controls("TopicBar1").pages("项目流程跟踪") Dim lnkb As WinForm.TopicLink = pageb.Links("未提交反馈") Dim cntb As Byte = DataTables("报价阶段表").Compute("count([_identify])"," 是否立项 = true And 参与报价 = true And 提交反馈 = False ") lnkb.Text = lnkb.Text & "(" & cntb & ")"
Dim paged As WinForm.TopicPage paged = Forms("导航栏").Controls("TopicBar1").pages("项目流程跟踪") Dim lnkd As WinForm.TopicLink = paged.Links("总经理未确认") Dim cntd As Byte = DataTables("报价阶段表").Compute("count([_identify])"," 是否立项 = true And 参与报价 = true And 提交反馈 = true And 总经理确认 = False") lnkd.Text = lnkd.Text & "(" & cntd & ")"
Dim pagee As WinForm.TopicPage pagee = Forms("导航栏").Controls("TopicBar1").pages("项目流程跟踪") Dim lnke As WinForm.TopicLink = pagee.Links("客户未最终确认") Dim cnte As Byte = DataTables("报价阶段表").Compute("count([_identify])"," 是否立项 = true And 参与报价 = true And 提交反馈 = true And 总经理确认 = true And 最终确认 = False") lnke.Text = lnke.Text & "(" & cnte & ")"
Dim pagef As WinForm.TopicPage pagef = Forms("导航栏").Controls("TopicBar1").pages("项目流程跟踪") Dim lnkf As WinForm.TopicLink = pagef.Links("未完成报价") Dim cntf As Byte = DataTables("报价阶段表").Compute("count([_identify])"," 是否立项 = true And 参与报价 = true And 提交反馈 = true And 总经理确认 = true And 最终确认 = true And 报价结束 = False") lnkf.Text = lnkf.Text & "(" & cntf & ")"
lnk = page.Links("七天内到截止日期") cnt = DataTables("报价阶段表").Compute("count([_identify])","项目截止时间<=#" & Date.Today.adddays(7) & "#") lnk.Text = lnk.Text & "(" & cnt & ")"
lnk = page.Links("三天内到截止日期") cnt = DataTables("报价阶段表").Compute("count([_identify])","项目截止时间<=#" & Date.Today.adddays(3) & "#") lnk.Text = lnk.Text & "(" & cnt & ")"
Dim pageg As WinForm.TopicPage Dim nms() As String = {"客户名称" ,"报价_供应商" , "项目经理"} For Each nm As String In nms pageg = Forms("导航栏").Controls("TopicBar1").pages(nm) For Each pd As String In DataTables("报价阶段表").GetValues(nm) Dim lnkg As WinForm.TopicLink = pageg.Links.Add(pd ,pd) Dim cntg As Integer = DataTables("报价阶段表").Compute("count([_identify])", nm & "=\'" & pd & "\'") lnkg.Text = lnkg.Text & "(" & cntg & ")" Next Next
Dim dt As DataTable Dim b As New GroupTableBuilder("统计表1",DataTables("产品订单管理")) b.Groups.AddDef("客户名称") b.Groups.AddDef("产品代号") b.Groups.AddDef("订单关闭") b.Totals.AddDef("订单关闭",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 Producta As String = "\'" & nd.DataRow("客户名称") & "\'" Dim Productb As String = "\'" & nd.DataRow("产品代号") & "\'" Dim Product As String = "\'" & nd.DataRow("订单关闭") & "\'" Select Case nd.Level Case 0 nd.Text = nd.text & "客户名称(" & dt.Compute("Sum(订单数)","客户名称 = " & Producta) & "条)" Case 1 nd.Text = nd.text & "产品代号(" & dt.Compute("Sum(订单数)","客户名称 = " & Producta & " And 产品代号 = " & Productb) & "条)" Case 2 nd.Text = nd.text & "产品代号(" & dt.Compute("Sum(订单数)","客户名称 = " & Producta & " And 产品代号 = " & Productb & " and 订单关闭 = " & Product) & "条)" Case 3 nd.Text = nd.text & "(" & nd.DataRow("订单数") & "条)" End Select Next trv.Nodes.Insert("显示所有行","显示所有行(" & dt.Compute("Sum(订单数)") & "条)",0) trv.ResumeRedraw
|
-- 作者:宁老师SQE
-- 发布时间:2018/12/21 18:22:00
--
筛选树解决了 但是这个没有解决啊 NET Framework 版本:2.0.50727.8800 Foxtable 版本:2018.10.9.1 错误所在事件: 详细错误信息: 未找到列 [项目流程跟踪]。
|
-- 作者:有点甜
-- 发布时间:2018/12/21 18:29:00
--
学会自己调试代码
http://www.foxtable.com/webhelp/scr/1485.htm
|
-- 作者:宁老师SQE
-- 发布时间:2018/12/21 18:56:00
--
早晨调试的时候还是好好的 我也没改代码啊 怎么就不好使了呢
|