Dim b As New CrossTableBuilder("统计表1",DataTables("窗口1_Table1")) b.VGroups.AddDef("年") b.VGroups.AddDef("月") b.HGroups.AddDef("地区") b.HGroups.AddDef("品牌") b.Totals.AddDef("数量") b.Totals.AddDef("金额") ' b.Subtotal = True '生成汇总模式 Tables("窗口1_Table1").DataSource = b.BuildDataSource()