如果是sqlserver数据源,可能要这样改。
Dim Filter As String
If e.Node.Text = "加载所有数据" Then
Filter = ""
Else
Dim dr As DataRow = e.Node.DataRow '获取生成此节点的行
Dim pname As String = dr("派单完成")
Dim Year As Integer = dr("年")
Dim Month As Integer = dr("月")
Select Case e.Node.Level
Case 0
Filter ="[派单完成] = " & iif(dr("派单完成") = False, 0, 1)
Case 1
Filter ="Year(日期) = " & Year
Case 2
Filter ="Year(日期) = " & Year & " And Month(日期) = " & Month
End Select
End If
With DataTables("生产派单")
.LoadFilter = Filter
.LoadPage = 0
.LoadTop = 10
.Load()
e.Form.Controls("TextBox1").Value = 1 & "/" & .TotalPages
End With