Dim db = HySq-l.DataBaseFactory.CreateDatabase("myjx") '
Dim Sq-l2 = "Selec-t a.采购单号,a.产品编号, a.品名, a.交货日期,b.供方, b.采购日期, b.供方,b.制单人,b.UserID From cgm_tb as a Inner Join cgz_tb as b On (a.采购单号 = b.采购单号) " & _
"where (b.制单人= '" & _Username & "' or b.UserID in ('" & s.Replace(",", "','") & "')) " & _
"And b.采购日期 >= '" & StartDate & "' And b.采购日期 <= '" & EndDate & "' "
Dim dt2 As system.data.DataTable = db.ExecuteDataSet(Sq-l2).Tables(0)
Dim t2 As Table = e.Form.Controls("Table1").Table
t2.datasource = dt2.Copy
t2.AllowEdit = False '
'目录树-按日期
Dim Sq-l3 = "SELEC-T DISTINCT Year(采购日期) As 年, Month(采购日期) As 月,采购单号,采购日期, 供方 From cgz_tb"
Dim dt3 As system.data.DataTable = db.ExecuteDataSet(Sq-l3).Tables(0)
Dim t3 As Table = e.Form.Controls("Table2").Table
t3.datasource = dt3.Copy
Dim trv3 As WinForm.TreeView = e.Form.Controls("TreeView4")
trv3.BuildTree("查询窗口_Table2", "年|月|供方")
Dim dr As DataRow = e.Node.DataRow '获取生成此节点的行
Dim Filter As String
Dim Year As Integer = dr("年")
Dim Month As Integer = dr("月")
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("查询窗口_Table2").LoadFilter = Filter
'DataTables("查询窗口_Table2").Load()
DataTables("查询窗口_Table1").LoadFilter = Filter
DataTables("查询窗口_Table1").Load()
单击目录树节点没反映,如何解决?