Dim filter As String = "1=1"
With e.Form.Controls("开始日期控件")
If .Text > "" Then
filter &= " and 日期 >= #" & .text & "#"
End If
End With
With e.Form.Controls("结束日期控件")
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("佣金业绩表")
[此贴子已经被作者于2014-6-5 9:20:06编辑过]