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("srflDropBox")
If .Value Is Nothing Then
Tables("收入明细窗体_srTable").GrandTotal = False
t = Tables("收入明细窗体_srTable")
removeHandler t.grid.Paint, AddressOf Grid_Paint
Tables("收入明细窗体_srTable").DataSource = DataTables("收支交易流水")
Tables("收入明细窗体_srTable").Filter = "记账日期>= #" & dt1 & "# And 记账日期 <= #" & dt2 & "# And 交易类型 = '收入'"
Tables("收入明细窗体_srTable").SetColVisibleWidth("单号|110|记账日期|90|收支分类原始值|200|收入金额|90|所属账户原始值|150|经手人原始值|90|备注|200")
t = Tables("收入明细窗体_srTable")
t.Cols("收入金额").GrandTotal = True '指定要合计的列
t.GrandTotal = True '显示合计模式
t.Grid.Name = t.Name
AddHandler t.grid.Paint, AddressOf Grid_Paint
End If
Dim drr As DataRow = DataTables("收入分类").find("收入目录='" & .Value & "'")
If drr IsNot Nothing Then
Dim str As String = DataTables("收入分类").GetComboListString("收入目录","收入分类代码='" & drr("收入分类代码") & "' Or 收入分类代码 Like '" & drr("收入分类代码") & "%'")
Filter = Filter & "收支分类 In ('" & str.Replace("|","','") & "')"
End If
If .Value IsNot Nothing Then
Filter = Filter & "记账日期>= #" & dt1 & "# And 记账日期 <= #" & dt2 & "#"
If Filter > "" Then
Filter = Filter & " And "
End If
End If
End With
With e.Form.Controls("sszhComboBox")
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("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("收入明细窗体_srTable").GrandTotal = False
t = Tables("收入明细窗体_srTable")
removeHandler t.grid.Paint, AddressOf Grid_Paint
Tables("收入明细窗体_srTable").DataSource = DataTables("收支交易流水")
Tables("收入明细窗体_srTable").Filter = "[交易类型] = '收入'"
Tables("收入明细窗体_srTable").SetColVisibleWidth("单号|110|记账日期|90|收支分类原始值|200|收入金额|90|所属账户原始值|150|经手人原始值|90|备注|200")
Tables("收入明细窗体_srTable").Filter = Filter
Dim dt As DataTable = Tables("收入明细窗体_srTable").DataTable
With dt
.DataCols("收支分类原始值").Caption = "收入分类"
.DataCols("所属账户原始值").Caption = "所属账户"
.DataCols("经手人原始值").Caption = "经手人"
.DataCols("备注").Caption = "说明"
.BuildHeader()
End With
t = Tables("收入明细窗体_srTable")
t.Cols("收入金额").GrandTotal = True '指定要合计的列
t.GrandTotal = True '显示合计模式
t.Grid.Name = t.Name
AddHandler t.grid.Paint, AddressOf Grid_Paint