我用窗口中的SQLquery表当做基本,做交叉表统计,显示不出明细来
Dim sp As Table=Tables(ckmc+"_sp") '临时表-商品明细
Dim spdm As String="A16S101N"
Dim tab As String="select spdm,spmc,gg1dm,gg1mc,gg2dm,gg2mc f rom VW_ShangpinMX where spdm='" & spdm & "' order by gg1dm,gg2dm"
sp.Fill(tab,"bserp",True)
sp.DataTable.DataCols.add("sl",Gettype(Integer),"1") '动态增加调转数量列
Dim spmx As New CrossTableBuilder("bs_spmx","sp")
spmx.HGroups.AddDef("gg1dm","颜色") '水平分组
spmx.HGroups.AddDef("gg1mc","颜色名称") '水平分组
spmx.VGroups.AddDef("gg2dm","尺码_{0}") '垂直分组
spmx.Totals.AddDef("sl",AggregateEnum.Sum) '添加数量列用于统计
spmx.HorizontalTotal=True '水平方向自动汇总
spmx.VerticalTotal=True '垂直方向自动汇总
''spmx.Subtotal = True '生成汇总模式
spmx.Build '生成统计表
此主题相关图片如下:qq截图20160826172851.jpg