Dim sql As String = "select * from {表B} b inner join {表A} a on b.编号 = a.编号" Dim b As New CrossTableBuilder("统计表1",sql) b.HGroups.AddDef("a.编号") b.HGroups.AddDef("客户") b.VGroups.AddDef("应收项目", "应收项目_{0}") b.Totals.AddDef("金额") b.HorizontalTotal = True b.VerticalTotal = True b.Build() MainTable = Tables("统计表1")