Dim b As New CrossTableBuilder("销售统计",dt) b.HGroups.AddDef("客户编号") '添加客户列用于水平分组 b.HGroups.AddDef("客户名称") b.HGroups.AddDef("客户地址") b.VGroups.AddDef("商品名称") '添加产品列用于垂直分组 b.Totals.AddDef("商品数量") '添加数量列用于统计 b.VerticalTotal= True '垂直汇总 b.HorizontalTotal = True '水平汇总
Dim t As Table = Tables("销售统计窗体_tblSale") t.Datasource = b.BuildDataSource