Foxtable(狐表)用户栏目专家坐堂 → 动态加载数据


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

主题:动态加载数据

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


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

加生成加载树,参考

 

http://www.foxtable.com/webhelp/scr/2054.htm

 

动态查询,就是把Filter改成LoadFilter。

 

数据量太大就请减少加载的次数和加载行数。


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


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

If e.sender.Text.Contains("[") OrElse e.sender.Text.Contains("'") OrElse e.sender.Text.Contains("*") OrElse e.sender.Text = "回车查询筛选树" Then
    Return
End If
Dim Values As New List (Of String)
Dim fltstr() As String
Dim txt As String = e.sender.Text
Dim flt As String
For Each c As Col In CurrentTable.Cols
    If c.DataCol.IsString AndAlso c.Name <> "拼音" Then
        Values.Add(c.Name)
    End If
Next
If Values.Count = 0 Then
    Return
End If
txt = txt.Trim()
If txt = "" Then
    flt = ""
Else
    If txt.Contains(",") Then
        fltstr = txt.split(",")
        Dim i As Integer = InStrRev(txt,",")
        Dim py As String = txt.SubString(i)
        py = "'%" & py & "%'"
        For Int As Integer = 0 To Values.Count - 1
            If CurrentTable.Cols(Values(Int)).DataCol.IsString = False Then
                Continue For
            End If
            For Index As Integer = 0 To fltstr.Length - 1
                If Int = Index Then
                    flt = flt & Values(Int) & " Like '%" & fltstr(Index) & "%'" & " And "
                Else
                    Continue For
                End If
            Next
        Next
        flt = Left(flt,flt.Length - 5)
        If CurrentTable.Cols.Contains("拼音") Then
            flt = flt & " Or 拼音 Like " & py
        End If
    Else
        txt = "'%" & txt & "%'"
        For Int As Integer = 0 To Values.Count - 1
            If CurrentTable.Cols(Values(Int)).DataCol.IsString = False Then
                Continue For
            End If
            flt = flt & Values(Int) & " Like " & txt & " Or "
        Next
        flt = Left(flt,flt.Length - 4)
        If CurrentTable.Cols.Contains("拼音") Then
            flt = flt & " Or 拼音 Like " & txt
        End If
    End If
End If
'CurrentTable.Filter = flt
msgbox(flt)
If flt > "" Then
    Tables("窗口2_table1").DataTable.LoadFilter = flt
    Tables("窗口2_table1").DataTable.Load
Else
    Tables("窗口2_table1").DataTable.LoadFilter = " 1 = 0 "
    Tables("窗口2_table1").DataTable.Load
End If


 回到顶部