请教老师,我写的代码,点击目录树节点,不会按条件选择,表的行都显示出来了
Dim dr As DataRow = e.Node.DataRow '获取生成此节点的行
Dim Filter As String
Filter = "上传类型_商务文件 = True"
Dim Year As Integer = dr("年").Replace("年", "")
Dim Month As Integer = dr("月").Replace("月", "")
Dim Product As String = dr("信息编号")
Select Case e.Node.Level
Case 0
Filter ="Year(上传时间) = " & Year
Case 1
Filter ="Year(上传时间) = " & Year & " And Month(上传时间) = " & Month
Case 2
Filter ="Year(上传时间) = " & Year & " And Month(上传时间) = " & Month & " And 信息编号 = '" & Product & "'"
End Select
DataTables("查询_Table20").LoadFilter = Filter
DataTables("查询_Table20").Load()
改写这样,到是可以了,不知这样写代码可对
Dim dr As DataRow = e.Node.DataRow '获取生成此节点的行 20160810
Dim Filter As String
Dim Year As Integer = dr("年").Replace("年", "")
Dim Month As Integer = dr("月").Replace("月", "")
Dim Product As String = dr("信息编号")
Select Case e.Node.Level
Case 0
Filter ="Year(上传时间) = " & Year & " And 上传类型_商务文件 = True "
Case 1
Filter ="Year(上传时间) = " & Year & " And Month(上传时间) = " & Month & " And 上传类型_商务文件 = True "
Case 2
Filter ="Year(上传时间) = " & Year & " And Month(上传时间) = " & Month & " And 信息编号 = '" & Product & "'" & " And 上传类型_商务文件 = True "
End Select
DataTables("查询_Table20").LoadFilter = Filter
DataTables("查询_Table20").Load()
[此贴子已经被作者于2016/8/11 18:02:27编辑过]