Case dalei =e.Form.Controls("suoyuoRadioButton").Checked
With e.Form.Controls("zcflDropBox")
If .Value Is Nothing Then
Tables("应付明细窗体_yfTable").GrandTotal = False
t = Tables("应付明细窗体_yfTable")
removeHandler t.grid.Paint, AddressOf Grid_Paint
Tables("应付明细窗体_yfTable").DataSource = DataTables("应付交易流水")
Tables("收入明细窗体_srTable").Filter =""
Tables("应付明细窗体_yfTable").SetColVisibleWidth("单号|110|应付金额|100|已付金额|100|交易分类原始值|160|记账日期|90|付款限期|90|经手人原始值|80|说明|200")
.DataCols("交易分类原始值").Caption = "支出分类"
.DataCols("经手人原始值").Caption = "经手人"
t = Tables("应付明细窗体_yfTable")
t.Cols("应付金额").GrandTotal = True '指定要合计的列
t.Cols("已付金额").GrandTotal = True '指定要合计的列
t.GrandTotal = True '显示合计模式
t.Grid.Name = t.Name
AddHandler t.grid.Paint, AddressOf Grid_Paint
Return
End If
If .Value IsNot Nothing Then
trv=Forms("以应付类型查找选择窗体").Controls("zcflTreeView")
If trv.SelectedNode IsNot Nothing Then
dr = trv.SelectedNode.DataRow()
Dim str As String = DataTables("支出分类").GetComboListString("支出目录","支出分类代码='" & dr("支出分类代码") & "' Or 支出分类代码 Like '" & dr("支出分类代码") & "%'")
Filter = "交易分类 In ('" & str.Replace("|","','") & "')"
End If
End If
End With
With e.Form.Controls("fkxqDateTimePicker")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "付款限期= '" & .Value & "'"
End If
End With
With e.Form.Controls("jbrComboBox")
If .Value IsNot Nothing AndAlso.value<>"所有经办人" Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "经手人 = '" & .Value & "'"
End If
End With
With e.Form.Controls("bzsmTextBox")
If .text <>"" Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "说明 Like '%" & .text & "%'"
End If
End With
Tables("应付明细窗体_yfTable").GrandTotal = False
t = Tables("应付明细窗体_yfTable")
removeHandler t.grid.Paint, AddressOf Grid_Paint
Tables("应付明细窗体_yfTable").DataSource = DataTables("应付交易流水")
Tables("应付明细窗体_yfTable").SetColVisibleWidth("单号|110|应付金额|100|已付金额|100|交易分类原始值|160|记账日期|90|付款限期|90|经手人原始值|80|说明|200")
Tables("应付明细窗体_yfTable").Filter = Filter
Dim dt As DataTable = Tables("应付明细窗体_yfTable").DataTable
With dt
.DataCols("交易分类原始值").Caption = "支出分类"
.DataCols("经手人原始值").Caption = "经手人"
.BuildHeader()
End With
t = Tables("应付明细窗体_yfTable")
t.Cols("应付金额").GrandTotal = True '指定要合计的列
t.Cols("已付金额").GrandTotal = True '指定要合计的列
t.GrandTotal = True '显示合计模式
t.Grid.Name = t.Name
AddHandler t.grid.Paint, AddressOf Grid_Paint
Case dalei =e.Form.Controls("bennianRadioButton").Checked
Dim y As Integer = Date.Today.Year
Dim dt1 As New Date(y, 1, 1)
Dim dt2 As New Date(y, 12, 31)
With e.Form.Controls("zcflDropBox")
If .Value Is Nothing Then
Tables("应付明细窗体_yfTable").GrandTotal = False
t = Tables("应付明细窗体_yfTable")
removeHandler t.grid.Paint, AddressOf Grid_Paint
Tables("应付明细窗体_yfTable").DataSource = DataTables("应付交易流水")
Tables("应付明细窗体_yfTable").Filter = "记账日期>= #" & dt1 & "# And 记账日期 <= #" & dt2 & "# "
Tables("应付明细窗体_yfTable").SetColVisibleWidth("单号|110|应付金额|100|已付金额|100|交易分类原始值|160|记账日期|90|付款限期|90|经手人原始值|80|说明|200")
t = Tables("应付明细窗体_yfTable")
t.Cols("应付金额").GrandTotal = True '指定要合计的列
t.Cols("已付金额").GrandTotal = True '指定要合计的列
t.GrandTotal = True '显示合计模式
t.Grid.Name = t.Name
AddHandler t.grid.Paint, AddressOf Grid_Paint
Return
End If
If .Value IsNot Nothing Then
Filter = Filter & "记账日期>= #" & dt1 & "# And 记账日期 <= #" & dt2 & "# "
If Filter > "" Then
Filter = Filter & " And "
End If
trv=Forms("以应付类型查找选择窗体").Controls("zcflTreeView")
If trv.SelectedNode IsNot Nothing Then
dr = trv.SelectedNode.DataRow()
Dim str As String = DataTables("支出分类").GetComboListString("支出目录","支出分类代码='" & dr("支出分类代码") & "' Or 支出分类代码 Like '" & dr("支出分类代码") & "%'")
Filter = Filter & "交易分类 In ('" & str.Replace("|","','") & "')"
End If
End If
End With
With e.Form.Controls("fkxqDateTimePicker")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "付款限期 = '" & .Value & "'"
End If
End With
With e.Form.Controls("jbrComboBox")
If .Value IsNot Nothing AndAlso.value<>"所有经办人" Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "经手人 = '" & .Value & "'"
End If
End With
With e.Form.Controls("bzsmTextBox")
If .text<>"" Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "说明 Like '%" & .text & "%'"
End If
End With
Tables("应付明细窗体_yfTable").GrandTotal = False
t = Tables("应付明细窗体_yfTable")
removeHandler t.grid.Paint, AddressOf Grid_Paint
Tables("应付明细窗体_yfTable").DataSource = DataTables("应付交易流水")
Tables("应付明细窗体_yfTable").SetColVisibleWidth("单号|110|应付金额|100|已付金额|100|交易分类原始值|160|记账日期|90|付款限期|90|经手人原始值|80|说明|200")
Tables("应付明细窗体_yfTable").Filter = Filter
Dim dt As DataTable = Tables("应付明细窗体_yfTable").DataTable
With dt
.DataCols("交易分类原始值").Caption = "支出分类"
.DataCols("经手人原始值").Caption = "经手人"
.BuildHeader()
End With
t = Tables("应付明细窗体_yfTable")
t.Cols("应付金额").GrandTotal = True '指定要合计的列
t.Cols("已付金额").GrandTotal = True '指定要合计的列
t.GrandTotal = True '显示合计模式
t.Grid.Name = t.Name
AddHandler t.grid.Paint, AddressOf Grid_Paint
[此贴子已经被作者于2020/4/17 9:07:24编辑过]