以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  筛选树  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=50807)

--  作者:散客
--  发布时间:2014/5/14 1:10:00
--  筛选树

Dim dt As DataTable
Dim b As new GroupTableBuilder("统计表1",DataTables("融资合同备案表"))
b.Groups.AddDef("接收日期",DateGroupEnum.Year,"年")
b.Groups.AddDef("接收日期",DateGroupEnum.Month,"月")
b.Groups.AddDef("备案单位")
b.Groups.AddDef("借款单位")
b.Totals.AddDef("备案编号",AggregateEnum.Count,"合同数")
dt = b.Build(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 year As  Integer = nd.DataRow("年")
    Dim month As Integer = nd.DataRow("月")
    Dim badw As String = nd.DataRow("备案单位")
    Dim jkdw As String = nd.DataRow("借款单位")
    Select Case nd.Level
        Case 0
            nd.Text = nd.text & "年(" & dt.Compute("sum(合同数)","年 = " & year) & "份合同)"
        Case 1
            nd.text = nd.Text & "月(" & dt.Compute("sum(合同数)","年 = " & year & " and 月 = " & month) & "份合同)"
        Case 2
            nd.text = nd.text & "(" & dt.Compute("sum(合同数)","年 = " & year & " And 月 = " & month & " and 备案单位 = " & badw) & "份合同)"
        Case 3
            nd.text = nd.text & "(" & nd.DataRow("合同数") & "份合同)"
\'nd.Text = nd.Text & "(" & dt.Compute("sum(合同数)","备案单位 = " & badw & " and 借款单位 = " & jkdw & " and 年 = " & year & " and 月 = " & month) & "份合同)"
    End Select
Next
trv.Nodes.Insert("显示所有行","显示所有行(" & dt.Compute("sum(合同数)") & "份合同)",0)
trv.ResumeRedraw

 

红色一行报错


--  作者:lsy
--  发布时间:2014/5/14 7:12:00
--  
nd.text = nd.text & "(" & dt.Compute("sum(合同数)","年 = " & year & " And 月 = " & month & " and 备案单位 = \'" & badw & "\'") & "份合同)"

--  作者:散客
--  发布时间:2014/5/14 12:18:00
--  

谢谢