Foxtable(狐表)用户栏目专家坐堂 → 目录树生成过程中系统崩溃


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

主题:目录树生成过程中系统崩溃

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


加好友 发短信
等级:小狐 帖子:350 积分:3412 威望:0 精华:0 注册:2015/5/12 15:33:00
目录树生成过程中系统崩溃  发帖心情 Post By:2016/8/16 9:21:00 [只看该作者]

'生成统计表

Dim dt As DataTable

Dim b As New sqlGroupTableBuilder("total","员工家庭")

b.ConnectionName = "HaiHeBase"

b.filter = ""

b.Groups.AddDef("房产现状")

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 bm As String = nd.DataRow("部门村居")

    Dim sz As String = nd.DataRow("所站办组")

    Dim aq As String = nd.DataRow("房产现状")

    Dim xm As String = nd.DataRow("户主姓名")

    Select Case nd.Level

        Case 0

            nd.Text = nd.text & "(" & dt.Compute("count(结构)","房产现状 = '" & aq & "'") & ")"

        Case 1

            nd.Text = nd.text & "(" & dt.Compute("count(结构)","房产现状 = '" & aq & "' and 部门村居 = '" & bm & "'")  & ")"

       Case 2

           nd.Text = nd.text & "(" & dt.Compute("count(结构)","房产现状 = '" & aq & "' and 部门村居 = '" & bm & "'  And 所站办组 = '" & sz & "'") & ")"

      Case 3

          nd.Text = nd.text & "(" & dt.Compute("count(结构)","房产现状 = '" & aq & "' and 部门村居 = '" & bm & "'  And 所站办组 = '" & sz & "' And 户主姓名 =  '" & xm & "'") & ")"

    End Select

Next

trv.Nodes.Insert("全镇房屋数","全镇房屋数(" & dt.Compute("count(结构)") & ")",0)

trv.ResumeRedraw

Dim t As WinForm.Table = e.Form.Controls("table1")

t.BackColor = Color.Lightblue

DataTables("安全_table1").SysStyles("EmptyArea").BackColor = Color.lightblue


上述代码如果不执行黄底部分,3万条数据,虽然要十几秒,还可以接受,但加入黄底部分,直接停止响应!查了一下,语句没有问题,请高人指点。


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


加好友 发短信
等级:狐神 帖子:5015 积分:25363 威望:0 精华:0 注册:2015/8/18 9:21:00
  发帖心情 Post By:2016/8/16 11:05:00 [只看该作者]

上例子测试,不然还是做成分页显示吧

 回到顶部