利用代码将目录树的是否逾期列从原来的"true false"显示改成中文后,会导致狐爸后面的代码报错,由于是系统报警,看不懂....
本页地址:http://www.foxtable.com/help/topics/2503.htm
报错信息
.NET Framework 版本:2.0.50727.5477
Foxtable 版本:2013.10.14.1
错误所在事件:
详细错误信息:
无法在 System.Boolean 和 System.String 上执行“=”操作。
利用的是狐爸的通用设计代码.
'------build复选筛选树
e.Form.Controls("TreeView1").BuildTree("任务追踪表", "是否逾期|责任部门|执行人")
'-----使筛选树的第一级node显示中文逾期
Dim trv1 As WinForm.TreeView = Forms("任务追踪").Controls("TreeView1")'使筛选树的第一级node显示中文逾期
For Each node As WinForm.TreeNode In trv1.Nodes
If node.text = False Then
node.text = "未逾期"
Else
'node.text = "逾期"
End If
Next
---通用代码
'设置复选筛选树
Dim nms As String() = {"是否逾期","责任部门","执行人"} '指定生成目录树的各列
Dim qts As String() = {"'","'","'"} '指定将各列的值括起来的符号,这里都是字符型,所以都是单引号
Dim trv As WinForm.TreeView = e.Sender
Dim flt As String
Dim nd As WinForm.TreeNode
For Each nd In e.node.allNodes '清除子节点的选中标记
nd.Checked = False
Next
nd = e.Node.ParentNode
Do While nd IsNot Nothing '清除父节点的选中标记
nd.Checked = False
nd = nd.ParentNode
Loop
For Each nd In trv.AllNodes
If nd.Checked Then
MessageBox.Show(nd.fullpath)
Dim rts() As String = nd.FullPath.Split("\")
Dim val As String = ""
For i As Integer = 0 To rts.length - 1
If val > "" Then
val = val & " And "
End If
val = val & nms(i) & " = " & qts(i) & rts(i) & qts(i)
Next
If flt > "" Then
flt = flt & " Or (" & val & ")"
Else
flt = val
End If
End If
Next
e.Form.Controls("Table2").Table.Filter = flt