回复8楼,帮你做了【按部门】的,其余两种,留给做作业。
参考
Dim t As Table = Tables("设备表")
If e.node.Level > 0 Then
If e.Node.FullPath.StartsWith("按部门") Then
If e.node.Nodes.count > 0 Then
Dim sidx As Integer = e.node.FullPath.IndexOf("\")
Dim dept As String = e.node.FullPath.SubString(sidx+1)
t.Filter = "所在部门 like '*" & dept & "*'"
Else
Dim sidx As Integer = e.node.FullPath.IndexOf("\")
Dim eidx As Integer = e.node.FullPath.LastIndexOf("\")
Dim dept As String = e.node.FullPath.SubString(sidx+1, eidx-sidx-1)
Dim fac As String = e.node.FullPath.SubString(eidx+1)
t.Filter = "所在部门 = '" & dept & "' and 安装地点 = '" & fac & "'"
End If
Else If e.Node.FullPath.StartsWith("") Then
Else If e.node.FullPath.StartsWith("") Then
End If
Else
t.Filter = ""
End If