Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共2 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:目录树问题

1楼
15666282205 发表于:2024/6/3 9:14:00
老师,我设计了带统计的目录树,但是数据量大了以后启动很慢,我想把统计功能去掉,麻烦您帮忙看看怎么改代码
''---------------------------------设置工艺卡筛选树(按日期显示)--------------------------------------------
''首先生成统计表
Dim dt8 As DataTable
Dim b8 As New sqlGroupTableBuilder("统计表零件目录","零件目录表")
b8.C
b8.Groups.AddDef("日期",DateGroupEnum.Year,"年")
b8.Groups.AddDef("日期",DateGroupEnum.Month,"月")
b8.Groups.AddDef("日期",DateGroupEnum.day,"日")
b8.Groups.AddDef("零件序号")
b8.Totals.AddDef("零件序号",AggregateEnum.Count,"次数") '根据客户列来统计记录数,也就是订单数
dt8 = b8.Build(True) '参数设置为True,生成一个临时表,不在主界面显示
'然后根据统计表生成目录树
Dim trv8 As WinForm.TreeView = e.Form.Controls("TreeView2")
trv8.BuildTree(dt8, "年|月|日|零件序号")
trv8.StopRedraw
For Each nd As WinForm.TreeNode In trv8.AllNodes
    Dim Year As Integer = nd.DataRow("年")
    Dim Month As Integer = nd.DataRow("月")
    Dim day As Integer = nd.DataRow("日")
    Dim Product5 As String = nd.DataRow("零件序号")
        Select Case nd.Level
        Case 0
            nd.Text = nd.text & "年(" & dt8.Compute("Sum(次数)","年 = " & Year) & ")"
        Case 1
            nd.Text = nd.text & "月(" & dt8.Compute("Sum(次数)","年 = " & Year & " And 月 = " & Month) & ")"
        Case 2
            nd.Text = nd.text & "日(" & dt8.Compute("Sum(次数)","年 = " & Year & " And 月 = " & Month & " and 日 = " & day) & ")"
        Case 3
            nd.Text = nd.text & "#(" & dt8.Compute("Sum(次数)","年 = " & Year & " And 月 = " & Month & " and 日 = " & day & " And  零件序号 = '" & nd.Text & "'") & ")"
           
        Case 4
            nd.Text = nd.text & "(" & nd.DataRow("次数") & ")"
    End Select
Next
trv8.Nodes.Insert("所有行","所有行(" & dt8.Compute("Sum(次数)") & ")",0)
trv8.ResumeRedraw

[此贴子已经被作者于2024/6/3 9:14:24编辑过]
2楼
有点蓝 发表于:2024/6/3 13:57:00
trv8.BuildTree(dt8, "年|月|日|零件序号")这一句之后的代码全部去掉
共2 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .03125 s, 2 queries.