Foxtable(狐表)用户栏目专家坐堂 → [求助]可多选的通用筛选目录树 单元格斜线多值失效,请教


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

主题:[求助]可多选的通用筛选目录树 单元格斜线多值失效,请教

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2017/7/18 16:28:00 [显示全部帖子]

 目录树尽量不要用 \ 这样的name或者text,不然代码要改。

 

 建议把 c:\@f@ 改成 c:/@f@ 这样就不需要改代码


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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2017/7/18 16:29:00 [显示全部帖子]

以下是引用湛江智在2017/7/18 16:14:00的发言:
添加附件,压缩包、狐表、access数据库文件上传失败,是网站有问题还是我这边网络问题呢?

 

1、使用ie浏览器访问论坛;

 

2、压缩包文件不能大于2M。


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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2017/7/18 17:10:00 [显示全部帖子]

c:\test.jpg 和 c:/test.jpg 是等效的,都可以正常访问路径。


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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2017/7/18 17:16:00 [显示全部帖子]

Dim s As String = e.Form.Controls("CheckedComboBox筛选树").Text
Dim Colstr() As String
Dim qts As String() = {"'","#",""}
Dim trv As WinForm.TreeView = e.Sender
Dim flt As String = ""
Dim nd As WinForm.TreeNode
Dim pd As WinForm.TreeNode
Dim notchecked As Integer = 0
Colstr = s.split("|")
For i As Integer = 0 To Colstr.Length - 1
    If CurrentTable.Cols.Contains(Colstr(i)) = False Then
        If trv.Nodes.Count > 0 Then
            trv.Nodes.Clear()
        End If
        e.Form.Controls("CheckedComboBox筛选树").Text = "选择筛选列(最好包括拼音)"
        Return
    End If
Next
If e.Node.Name = "显示所有行" Then
    If e.Node.Checked = True Then
        For Each nd In trv.AllNodes
            If nd.Name <> "显示所有行" Then
                nd.Checked = False
            End If
        Next
        CurrentTable.Filter = ""
    Else
        For Each nd In trv.AllNodes
            nd.Checked = False
        Next
        CurrentTable.Filter = (1 = 2)
    End If
    trv.CollapseAll
    Return
Else
    trv.AllNodes(0).Checked = False
End If
For Each nd In e.node.allNodes
    nd.Checked = False
Next
pd = e.Node.ParentNode
Do While pd IsNot Nothing
    pd.Checked = False
    pd = pd.ParentNode
Loop
For Each nd In trv.AllNodes
    If nd.Checked  Then
        Dim rts(nd.level) As String
        Dim tnd = nd
        For i As Integer = nd.level To 0 Step-1
            rts(i) = tnd.text
            tnd = tnd.ParentNode
        Next
        Dim val As String = ""
        For i As Integer = 0 To rts.length - 1
            If CurrentTable.DataTable.DataCols(Colstr(i)).IsString Then
                If rts(i) <> "空" Then
                    If val > "" Then
                        val = val & " And "
                        val = val & Colstr(i) & " = " & qts(0) & rts(i) & qts(0)
                    Else
                        val = val & Colstr(i) & " = " & qts(0) & rts(i) & qts(0)
                    End If
                ElseIf rts(i) = "空" Then
                    If val > "" Then
                        val = val & " And "
                        val = val & Colstr(i) & " Is Null"
                    Else
                        val = val & Colstr(i) & " Is Null"
                    End If
                End If
            ElseIf CurrentTable.DataTable.DataCols(Colstr(i)).IsDate Then
                If rts(i) <> #0001-1-1 0:00:00# Then
                    If val > "" Then
                        val = val & " And "
                        val = val & Colstr(i) & " = " & qts(1) & rts(i) & qts(1)
                    Else
                        val = val & Colstr(i) & " = " & qts(1) & rts(i) & qts(1)
                    End If
                ElseIf rts(i) = #0001-1-1 0:00:00# Then
                    If val > "" Then
                        val = val & " And "
                        val = val & Colstr(i) & " Is Null"
                    Else
                        val = val & Colstr(i) & " Is Null"
                    End If
                End If
            ElseIf CurrentTable.DataTable.DataCols(Colstr(i)).IsNumeric Then
                If rts(i) <> 0 Then
                    If val > "" Then
                        val = val & " And "
                        val = val & Colstr(i) & " = " & qts(2) & rts(i) & qts(2)
                    Else
                        val = val & Colstr(i) & " = " & qts(2) & rts(i) & qts(2)
                    End If
                ElseIf rts(i) = 0 Then
                    If val > "" Then
                        val = val & " And "
                        val = val & Colstr(i) & " Is Null"
                    Else
                        val = val & Colstr(i) & " Is Null"
                    End If
                End If
            ElseIf CurrentTable.DataTable.DataCols(Colstr(i)).IsBoolean Then
                If rts(i) <> False Then
                    If val > "" Then
                        val = val & " And "
                        val = val & Colstr(i) & " = " & qts(0) & True & qts(0)
                    Else
                        val = val & Colstr(i) & " = " & qts(0) & True & qts(0)
                    End If
                ElseIf rts(i) = False Then
                    If val > "" Then
                        val = val & " And "
                        val = val & Colstr(i) & " = " & qts(0) & False & qts(0)
                    Else
                        val = val & Colstr(i) & " = " & qts(0) & False & qts(0)
                    End If
                End If
            End If
        Next
        If flt > "" Then
            flt = flt & " Or (" & val & ")"
        Else
            flt = val
        End If
        notchecked + = 1
    End If
Next
If flt > "" AndAlso notchecked > 0 Then
    CurrentTable.Filter = flt
Else
    CurrentTable.Filter = (1 = 2)
End If

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2017/7/18 17:39:00 [显示全部帖子]

以下是引用湛江智在2017/7/18 17:32:00的发言:
老大,单元格下拉窗口,选择目录树子节点,把上面的节点也一起输入代码怎么修改呢? 
比如选择节点:上海,输入值为:中国\上海
见1楼图片

 

e.Form.DropDownBox.Value = e.Node.FullPath
e.Form.DropDownBox.CloseDropDown()


 回到顶部