以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [求助]在窗口内做自定义筛选,发现只能筛选数字和英文,文本失效 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=188932) |
-- 作者:lovelypig122 -- 发布时间:2023/10/31 20:30:00 -- [求助]在窗口内做自定义筛选,发现只能筛选数字和英文,文本失效 不知道是不是因为把2019的foxtable升级到2022的原因 原本的筛选功能,文本的筛选失灵了,英文及数字的正常,找了半天没发现原因,不过数字和英文都可以,只有中文文本不行。 代码如下: Dim filter As String Dim sts() As String = {"合同号", "客户名称", "业务员", "长度", "宽度", "厚度", "原料产地", "事业部"} For Each st As String In sts Dim val As String = e.Form.Controls(st).value If val > "" Then val = val.Replace("*", "[*]") If filter = "" Then filter = st & " like \'%" & val & "%\'" Else filter = filter & " and " & st & " like \'%" & val & "%\'" End If End If Next If e.Form.Controls("已完结").Checked = True Then\' 如果付款状态选择了"已付" If Filter > "" Then Filter = Filter & " And " End If Filter = Filter & "合同完结 = 1" End If If e.Form.Controls("未完结").Checked = True Then\' 如果付款状态选择了"未付" If Filter > "" Then Filter = Filter & " And " End If Filter = Filter & "(合同完结 = 0 Or 合同完结 Is Null)" End If With e.Form.Controls("实际交货期起始日") If .Value IsNot Nothing Then If Filter > "" Then Filter = Filter & " And " End If Filter = Filter & "日期 >= \'" & .Value & "\'" End If End With With e.Form.Controls("实际交货期结束日") If .Value IsNot Nothing Then If Filter > "" Then Filter = Filter & " And " End If Filter = Filter & "日期 <= \'" & .Value & "\'" End If End With DataTables("销售合同基础表").LoadFilter = Filter DataTables("销售合同基础表").load() |
-- 作者:有点蓝 -- 发布时间:2023/10/31 20:34:00 -- 这个应该是数据库使用的不是中文的字符集。 |
-- 作者:lovelypig122 -- 发布时间:2023/10/31 21:53:00 -- 谢谢,成功解决,修改排序规则即可 |