Dim Filter As String
Dim t As Table
Dim StartDate As Date =qssj.Value
Dim EndDate As Date=zzsj.Value
If e.Form.Controls("mxRadioButton").Checked
If qssj.Value IsNot Nothing AndAlso zzsj.Value IsNot Nothing Then
Filter = Filter & "转账日期>= #" & StartDate & "# And 转账日期 <= #" & EndDate & "# "
End If
If zzmc.value<>"所有账户" AndAlso zzmc.value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
If zzlx.value = "所有转账" OrElse zzlx.value Is Nothing
Filter = Filter & " (转出账户='" & zzmc.value & "' or 转入账户='" & zzmc.value & "')"
ElseIf zzlx.value = "转出账户"
Filter = Filter & " 转出账户='" & zzmc.value & "'"
Else
Filter = Filter & " 转入账户='" & zzmc.value & "'"
End If
End If
Tables("转账查询窗体_zzTable").GrandTotal = False
Tables("转账查询窗体_zzTable").DataSource = DataTables("转账交易流水")
Tables("转账查询窗体_zzTable").SetColVisibleWidth("转账日期|100|转出账户|200|转入账户|200|转账金额|100|转出后账户余额|100|转入后账户余额|100|转账操作员|100|转账备注|260")
Tables("转账查询窗体_zzTable").Filter = Filter
t = Tables("转账查询窗体_zzTable")
t.Cols("转账金额").GrandTotal = True '指定要合计的列
t.GrandTotal = True '显示合计模式
t.Grid.Name = t.Name
AddHandler t.grid.Paint, AddressOf Grid_Paint
Tables("转账查询窗体_zzTable").GrandTotal = True
Else
If qssj.Value IsNot Nothing AndAlso zzsj.Value IsNot Nothing Then
Filter = Filter & "转账日期>= #" & StartDate & "# And 转账日期 <= #" & EndDate & "# "
End If
If zzmc.value<>"所有账户" AndAlso zzmc.value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
If zzlx.value = "所有转账" OrElse zzlx.value Is Nothing
Filter = Filter & " (转出账户='" & zzmc.value & "' or 转入账户='" & zzmc.value & "')"
ElseIf zzlx.value = "转出账户"
Filter = Filter & " 转出账户='" & zzmc.value & "'"
Else
Filter = Filter & " 转入账户='" & zzmc.value & "'"
End If
End If
'Tables("转账查询窗体_zzTable").DataSource = DataTables("转账交易流水")
'Tables("转账查询窗体_zzTable").SetColVisibleWidth("转账日期|100|转出账户|200|转入账户|200|转账金额|100|转出后账户余额|100|转入后账户余额|100|转账操作员|100|转账备注|260")
'Tables("转账查询窗体_zzTable").Filter = Filter
SystemReady = False
Dim g As New GroupTableBuilder("转账交易统计表", DataTables("转账交易流水"))
g.Groups.AddDef("转账日期",DateGroupEnum.None,"转账日期")
g.Groups.AddDef("转出账户","转出账户")
g.Groups.AddDef("转入账户","转入账户")
g.Totals.AddDef("转账金额","转账金额")
g.Build()
MainTable = Tables("转账交易统计表")
Tables("转账查询窗体_zzTable").DataSource = DataTables("转账交易统计表")
Tables("转账查询窗体_zzTable").Filter = Filter
If zzlx.Value="转出账户" Then
Tables("转账查询窗体_zzTable").SetColVisibleWidth("转出账户|300|转账金额|300")
Else
Tables("转账查询窗体_zzTable").SetColVisibleWidth("转入账户|300|转账金额|300")
End If
For Each c As Col In Tables("转账查询窗体_zzTable").Cols
c.TextAlign = TextAlignEnum.Center
Next
SystemReady = True
End If