请教:
'--------------树目录筛选--------------
Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
Forms("综合查询窗口").Controls("Label1").Text = "业务受理情况"
'三级目录
NodeLevel0 = "产品类别"
NodeLevel1 = "产品分类"
NodeLevel2 = ""
'查询的日期字段
DateSt = "受理日期"
Dim TreeSt As String
If NodeLevel2 = "" Then
If NodeLevel1 = "" Then
TreeSt = NodeLevel0
Else
TreeSt = NodeLevel0 & "|" & NodeLevel1
End If
Else
TreeSt = NodeLevel0 & "|" & NodeLevel1 & "|" & NodeLevel2
End If
trv.BuildTree("业务流程表", TreeSt)
trv.Nodes.Insert("加载所有数据","加载所有数据",0)
'MessageBox.Show("节点名称: " & e.node.NAME)
Tables("业务流程表").SetColVisibleWidth("受理日期|90|报告编号|160|任务来源|80|检验类别|50|检验分类|110|产品类别|80|产品分类|110|客户名称|250|样品名称|150|样品型号规格|100|样品数量|50|")
Tables("业务流程表").Filter = ""
NodeMouseDoubleClick
'--------------树目录筛选--------------
Dim CountStr As String
Dim Filter As String
Dim Filter0 As String
Dim Filter1 As String
Dim Filter2 As String
Dim dr As DataRow = e.Node.DataRow '获取生成此节点的行
If NodeLevel2 = "" Then
Filter2 = ""
Else
Filter2 = " And [" & NodeLevel2 & "] = '" & dr(NodeLevel2) & "'"
End If
If NodeLevel1 = "" Then
Filter1 = ""
Else
Filter1 = " And [" & NodeLevel1 & "] = '" & dr(NodeLevel1) & "'"
End If
Filter0 = " AND [" & NodeLevel0 & "] = '" & dr(NodeLevel0) & "'"
Dim cnt As Integer
'MessageBox.Show(NodeLevel0)
If e.node.TEXT = "加载所有数据" Then
Filter = ""
Else
Select Case e.Node.Level
Case 0
Filter = FilterDate & Filter0 & "And " & DateSt & " Is NOT Null"
CountStr = "Count([" & NodeLevel0 & "])"
Case 1
Filter = FilterDate & Filter0 & Filter1 & "And " & DateSt & " Is NOT Null"
CountStr = "Count([" & NodeLevel1 & "])"
Case 2
Filter = FilterDate & Filter0 & Filter1 & Filter2 & "And " & DateSt & " Is NOT Null"
CountStr = "Count([" & NodeLevel2 & "])"
End Select
End If
Tables("业务流程表").Filter = Filter
cnt = DataTables("业务流程表").Compute(CountStr,Filter)
e.Form.Controls("Label4").TEXT = "产品类别: " & e.node.TEXT
e.Form.Controls("Label5").TEXT = "项目总数: " & cnt
e.Form.Controls("Label6").TEXT = "时间范围: " & dt1 & " 至 " & dt2
'MessageBox.Show(cnt)
双击"加载所有数据",出现:
错误所在事件:窗口,综合查询窗口,TreeView1,NodeMouseDoubleClick
详细错误信息:
未将对象引用设置到对象的实例。