Dim g As New CrossTableBuilder("统计表1", DataTables("表A")) g.HGroups.AddDef("产品","产品名称") g.HGroups.AddDef("应付金额","应收金额") g.HorizontalTotal = True g.VerticalTotal = True g.Filter = "付款方式 = '未付'" Tables("窗口1_Table1").DataSource = g.BuildDataSource For Each c As col In Tables("窗口1_Table1").Cols Next Tables("窗口1_Table1").BuildHeader