以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 求助 采用分页加载后按条件筛选问题 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=52146) |
-- 作者:188802386 -- 发布时间:2014/6/10 10:50:00 -- 求助 采用分页加载后按条件筛选问题 我选择了分页查询 窗口表事件
窗口与控件事件
佣金一览表_AfterLoad
Dim cmb As WinForm.ComboBox = e.form.Controls("ComboBox1") cmb.ComboList = DataTables("佣金明细").GetComboListString("所属区域") \'==========实现分页加载============ With DataTables("佣金明细") .LoadFilter = "" \'一定要清除加载条件 .LoadTop = 20 .LoadPage = 0 .Load() End With
佣金一览表_Button1_Click
Dim filter As String = "1=1" With e.Form.Controls("startDate") If .Text > "" Then filter &= " and 结佣日 >= #" & .text & "#" End If End With With e.Form.Controls("EndDate") If .Text > "" Then filter &= " and 结佣日 <= #" & .text & "#" End If End With Dim g As New CrossTableBuilder("佣金业绩表", DataTables("佣金明细")) g.HGroups.AddDef("门店") g.HGroups.AddDef("置业顾问") g.VGroups.AddDef("类型") g.Totals.AddDef("佣金", "佣金") g.Totals.AddDef("套数", "套数") g.OrderByTotal = True g.HorizontalTotal = True g.VerticalTotal = True g.Decimals = 2 g.Subtotal = True g.Filter = Filter g.Build() MainTable = Tables("佣金业绩表") Forms("佣金业绩表").show() MainTable = Tables("LILY")
佣金一览表_Button2_Click
With DataTables("佣金明细") If .LoadPage <> 0 Then .LoadTop = 20 .LoadPage = 0 .Load() End If End With
佣金一览表_Button3_Click
With DataTables("佣金明细") If .LoadPage < .TotalPages - 1 Then .LoadPage = .LoadPage + 1 .Load() End If End With
佣金一览表_Button4_Click
With DataTables("佣金明细") If .LoadPage > 0 Then .LoadPage = .LoadPage - 1 .Load() End If End With
佣金一览表_Button5_Click
With DataTables("佣金明细") If .LoadPage < .TotalPages - 1 Then .LoadPage = .TotalPages - 1 .Load() End If End With
佣金一览表_ComboBox2_Enter
Dim cmb As WinForm.ComboBox = e.Sender Dim str As String = e.Form.Controls("ComboBox1").Value cmb.ComboList = DataTables("佣金明细").GetComboListString("门店", "所属区域 = \'" & str & "\'")
佣金一览表_ComboBox3_Enter
Dim cmb As WinForm.ComboBox = e.Sender Dim str As String = e.Form.Controls("ComboBox2").Value cmb.ComboList = DataTables("佣金明细").GetComboListString("置业顾问", "门店 = \'" & str & "\'")
佣金一览表_TextBox1_TextChanged
Dim txt As String = e.Form.Controls("TextBox1").Text Dim dt As DataTable = DataTables("佣金明细") If txt > "" Then txt = "\'%" & txt & "%\'" txt = "合同编号 Like " & txt & " Or 甲方姓名 Like " & txt & " Or 乙方姓名 Like " & txt & " Or 物业地址 Like " & txt & " Or 门店 Like " & txt & " Or 置业顾问 Like " & txt & " Or 店面经理 Like " & txt & " Or 所属区域 Like " & txt End If
dt.LoadFilter = txt dt.Load
佣金一览表_查询_Click
Dim Filter As String With e.Form.Controls("ComboBox1") If .Value IsNot Nothing Then Filter = "所属区域 = \'" & .Value & "\'" End If End With With e.Form.Controls("ComboBox2") If .Value IsNot Nothing Then If Filter > "" Then Filter = Filter & " And " End If Filter = Filter & "门店 = \'" & .Value & "\'" End If End With With e.Form.Controls("ComboBox3") If .Value IsNot Nothing Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "置业顾问 = \'" & .Value & "\'" End If End With With e.Form.Controls("StartDate") If .Value IsNot Nothing Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "结佣日 >= #" & .Value & "#" End If End With With e.Form.Controls("EndDate") If .Value IsNot Nothing Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "结佣日 <= #" & .Value & "#" End If End With If e.Form.Controls("rdoYifu").Checked = True \' 如果付款状态选择了"已付" If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "状态 Is Not Null" End If If e.Form.Controls("rdoWeifu").Checked = True \' 如果付款状态选择了"未付" If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "状态 Is Null" End If If Filter > "" Then Tables("佣金明细").Filter = Filter End If
佣金一览表_撤销查询_Click
Tables("佣金明细").ApplyFilter = False
佣金一览表_清除条件_Click
e.Form.Controls("ComboBox1").Value = Nothing e.Form.Controls("ComboBox2").Value = Nothing e.Form.Controls("ComboBox3").Value = Nothing e.Form.Controls("StartDate").Value = Nothing e.Form.Controls("EndDate").Value = Nothing e.Form.Controls("rdoAll").Checked = True [此贴子已经被作者于2014-6-10 10:51:23编辑过]
|
-- 作者:Bin -- 发布时间:2014/6/10 10:51:00 -- 设置表的LoadFIlter=Filter 然后LOad |
-- 作者:有点甜 -- 发布时间:2014/6/10 10:52:00 -- 改一改这段,就行了
If Filter > "" Then Tables("佣金明细").Filter = Filter End If
改成
If Filter > "" Then DataTables("佣金明细").LoadFilter = Filter DataTables("佣金明细").Load End If |
-- 作者:188802386 -- 发布时间:2014/6/10 11:13:00 -- 提示 |
-- 作者:有点甜 -- 发布时间:2014/6/10 11:22:00 -- 回复4楼,#改成单引号\'
With e.Form.Controls("StartDate") If .Value IsNot Nothing Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "结佣日 >= \'" & .Value & "\'" End If End With With e.Form.Controls("EndDate") If .Value IsNot Nothing Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "结佣日 <= \'" & .Value & "\'" End If End With |
-- 作者:188802386 -- 发布时间:2014/6/10 11:44:00 -- 佣金一览表_AfterLoad
Dim cmb As WinForm.ComboBox = e.form.Controls("ComboBox1") cmb.ComboList = DataTables("佣金明细").GetComboListString("所属区域") 佣金一览表_ComboBox2_Enter
Dim cmb As WinForm.ComboBox = e.Sender Dim str As String = e.Form.Controls("ComboBox1").Value cmb.ComboList = DataTables("佣金明细").GetComboListString("门店", "所属区域 = \'" & str & "\'")
佣金一览表_ComboBox3_Enter
Dim cmb As WinForm.ComboBox = e.Sender Dim str As String = e.Form.Controls("ComboBox2").Value cmb.ComboList = DataTables("佣金明细").GetComboListString("置业顾问", "门店 = \'" & str & "\'") 这个原来是全部加载了数据可以筛选,但现在实现分页加载后 我想实现区域 门店 置业顾问 能像全部加载后那样的筛选 应该是要涉及到数据源 请问具体改如何操作呢 另外还有就是 重复佣金业绩表 就提示某些列不存在 [此贴子已经被作者于2014-6-10 11:45:11编辑过]
|
-- 作者:有点甜 -- 发布时间:2014/6/10 12:13:00 -- 回复6楼。GetComboListString 改成 SqlGetComboListString 即可。 |
-- 作者:188802386 -- 发布时间:2014/6/10 12:33:00 -- 谢谢老师 另外 我按条件筛选后加入有两页内容 点击成成佣金业绩表 生成出来的数据就只有佣金一览表显示出来的那页数据 Dim filter As String = "1=1" With e.Form.Controls("ComboBox1") If .Value IsNot Nothing Then Filter = "所属区域 = \'" & .Value & "\'" End If End With With e.Form.Controls("ComboBox2") If .Value IsNot Nothing Then If Filter > "" Then Filter = Filter & " And " End If Filter = Filter & "门店 = \'" & .Value & "\'" End If End With With e.Form.Controls("ComboBox3") If .Value IsNot Nothing Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "置业顾问 = \'" & .Value & "\'" End If End With With e.Form.Controls("startDate") If .Text > "" Then filter &= " and 结佣日 >= ‘" & .text & "’" End If End With With e.Form.Controls("EndDate") If .Text > "" Then filter &= " and 结佣日 <= ’" & .text & "‘" End If End With If e.Form.Controls("rdoYifu").Checked = True \' 如果付款状态选择了"已付" If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "状态 Is Not Null" End If If e.Form.Controls("rdoWeifu").Checked = True \' 如果付款状态选择了"未付" If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "状态 Is Null" End If Dim g As New CrossTableBuilder("佣金业绩表", DataTables("佣金明细")) g.HGroups.AddDef("门店") g.HGroups.AddDef("置业顾问") g.VGroups.AddDef("类型") g.Totals.AddDef("佣金", "佣金") g.Totals.AddDef("套数", "套数") g.OrderByTotal = True g.HorizontalTotal = True g.VerticalTotal = True g.Decimals = 2 g.Subtotal = True g.Filter = Filter g.Build() MainTable = Tables("佣金业绩表") Forms("佣金业绩表").show() MainTable = Tables("LILY") |
-- 作者:有点甜 -- 发布时间:2014/6/10 14:00:00 -- 用SqlCrossTableBuilder,这个是直接统计后台数据的。
http://www.foxtable.com/help/topics/1627.htm
|