此主题相关图片如下:4.jpg
奇怪,不加条件加载速度还好,加上搜索条件,就直接卡死不动。不知道什么原因。。。
Dim Filter As String
With e.Form.Controls("ComboBox1")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "门店 in ( '" & .text.replace(",","','") & " ') "
End If
End With
With e.Form.Controls("checkedComboBox1")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "库位 in ( '" & .text.replace(",","','") & " ') "
End If
End With
With e.Form.Controls("checkedComboBox2")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "调整期间 in ( '" & .text.replace(",","','") & " ') "
End If
End With
Dim bd1 As New SQLcrossTableBuilder("统计表1","库位销售分析")
Dim dt1 As fxDataSource
bd1.C
bd1.HGroups.AddDef("门店") '添加客户列用于水平分组
bd1.HGroups.AddDef("库位") '添加客户列用于水平分组
bd1.HGroups.AddDef("销售日期",DateGroupEnum.year,"区间") '添加客户列用于水平分组
If e.Form.Controls("CheckBox6").checked = False Then
bd1.vGroups.AddDef("调整期间","调整期间_{0}_销售量") '添加客户列用于水平分组
Else
bd1.vGroups.AddDef("调整期间","调整期间_{0}") '添加客户列用于水平分组
End If
bd1.Totals.AddDef("销售数量","销售量") '添加数量列用于统计
If e.Form.Controls("CheckBox6").checked = True Then
bd1.Totals.AddDef("销售金额","销售额") '添加数量列用于统计
End If
bd1.filter = filter
bd1.CommandTimeOut = 600
dt1 = bd1.BuildDataSource()
Dim bd2 As New SQLcrossTableBuilder("统计表2","动销量")
Dim dt2 As fxDataSource
bd2.C
bd2.HGroups.AddDef("门店") '添加客户列用于水平分组
bd2.HGroups.AddDef("库位") '添加客户列用于水平分组
bd2.vGroups.AddDef("调整期间","调整期间_{0}_动销量") '添加客户列用于水平分组
bd2.Totals.AddDef("动销量") '添加数量列用于统计
bd2.filter = filter
bd2.CommandTimeOut = 600
dt2 = bd2.BuildDataSource()
Dim bd3 As New SQLcrossTableBuilder("统计表3","陈列量")
Dim dt3 As fxDataSource
bd3.C
bd3.HGroups.AddDef("门店") '添加客户列用于水平分组
bd3.HGroups.AddDef("库位") '添加客户列用于水平分组
bd3.vGroups.AddDef("调整期间","调整期间_{0}_陈列量") '添加客户列用于水平分组
bd3.Totals.AddDef("陈列量") '添加数量列用于统计
bd3.filter = filter
bd3.CommandTimeOut = 600
dt3 = bd3.BuildDataSource()
Dim nms As String() = {"门店","库位"} '指定连接列
dt1.Combine(nms,dt2,nms) '将销售统计数据组合到进货统计数据
dt1.Combine(nms,dt3,nms) '将销售统计数据组合到进货统计数据
Tables(e.Form.Name & "_table1").DataSource = dt1
If Tables(e.Form.Name & "_table1").Cols.Contains("区间") Then
Tables(e.Form.Name & "_table1").Cols("区间").Visible = False
End If