能否筛选后显示人数,而非显示所有数据
成员信息_AfterLoad
Dim trv As
WinForm.TreeView = e.Form.Controls("TreeView1")
trv.BuildTree("成员信息",
"中小学|班级|性别")
For Each nd As
WinForm.TreeNode In trv.AllNodes
Dim filter As String = ""
If nd.Level = 0 Then
filter = "中小学 = '" &
nd.DataRow("中小学") & "'"
ElseIf nd.Level = 1 Then
filter = "中小学 = '" &
nd.DataRow("中小学") & "' and 班级 = '" &
nd.DataRow("班级") & "'"
ElseIf nd.Level = 2 Then
filter = "中小学 = '" &
nd.DataRow("中小学") & "' and 班级 = '" & nd.DataRow("班级")
& "' and 性别 = '" & nd.DataRow("性别") &
"'"
End If
Dim sum = DataTables("成员信息").Compute("count(_Identify)",
filter)
nd.Text = nd.Name & "(" &
sum & "人)"
Next
Dim d =
trv.Nodes.Insert("显示所有行", 0)
d.text = d.name
& "(" & DataTables("成员信息").Compute("count(_Identify)")
& "人)"
成员信息_Button5_Click
Tables("成员信息").DataTable.Load
Tables("成员信息").OpenFilterTree("性别|班级")
成员信息_TreeView1_NodeMouseClick
Dim Filter As
String = ""
Dim dr As DataRow
= e.Node.DataRow '获取生成此节点的行
If e.Node.name
<> "显示所有行" 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
Tables("成员信息").Filter
= Filter