以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [求助] 手动设计筛选树,用户“入库员”打开窗口后,出现错误提示?(问题项目已上传!) (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=96555) |
||||
-- 作者:fengwenliuyan -- 发布时间:2017/2/23 10:30:00 -- [求助] 手动设计筛选树,用户“入库员”打开窗口后,出现错误提示?(问题项目已上传!) 手动设计筛选树, 对账单窗口的AfterLoad事件代码: \'首先生成统计表 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 Product As String = nd.DataRow("客户") Dim gx As String = nd.DataRow("工序") Dim pmgg As String = nd.DataRow("品名规格") Select Case nd.Level Case 0 nd.Text = nd.text & "(" & dt.Compute("Sum(个数)","客户 = \'" & Product & "\'") & "条)" Case 1 nd.Text = nd.text & "(" & dt.Compute("Sum(个数)","客户 = \'" & Product & "\' And 工序 = \'" & gx & "\'") & "条)" Case 2 nd.Text = nd.text & "(" & dt.Compute("Sum(个数)","客户 = \'" & Product & "\' And 工序 = \'" & gx & "\' And 品名规格 = \'" & pmgg & "\'") & "条)" Case 3 nd.Text = nd.text & "(" & nd.DataRow("个数") & "条)" End Select Next trv.Nodes.Insert("显示所有行","显示所有行(" & dt.Compute("Sum(个数)") & "条)",0) trv.ResumeRedraw 目录树控件的NodeMouseDoubleClick事件代码: Dim Filter As String Dim dr As DataRow = e.Node.DataRow \'获取生成此节点的行 If e.Node.Text <> "显示所有行" Then Select Case e.Node.Level Case 0 Filter = "[客户] = \'" & dr("客户") & "\'" Case 1 Filter = "[客户] = \'" & dr("客户") & "\' And [工序] = \'" & dr("工序") & "\'" Case 2 Filter = "[客户] = \'" & dr("客户") & "\' And [工序] = \'" & dr("工序") & "\' And [品名规格] = \'" & dr("品名规格") & "\'" End Select End If e.Form.controls("对账单").Table.Filter = Filter 测试结果: [此贴子已经被作者于2017/2/23 10:35:54编辑过]
|
||||
-- 作者:有点蓝 -- 发布时间:2017/2/23 10:46:00 -- dt = b.Build(False)
改为
dt = b.Build(True) |
||||
-- 作者:fengwenliuyan -- 发布时间:2017/2/23 10:53:00 -- 改了之后还是一样的提示?
|
||||
-- 作者:有点色 -- 发布时间:2017/2/23 11:05:00 --
窗口->自动打开->设置成False
|