Dim bd1 As New GroupTableBuilder("统计表1",DataTables("ER_SCJH"))
Dim dt1 As fxDataSource
bd1.Groups.AddDef("BM") '根据车间分组
bd1.Groups.AddDef("DATE", DateGroupEnum.Year, "年度") '年份分组
bd1.Groups.AddDef("DATE", "月份")
bd1.Totals.AddDef("BFPTjine", "已配套金额_当月")
bd1.Totals.AddDef("BFPTjine", "已配套金额_累计",True)
bd1.Filter = "[是否完成] = '否'or [PT] = '是'"
dt1 = bd1.BuildDataSource()
Dim bd2 As New GroupTableBuilder("统计表2",DataTables("ER_SCJH"))
Dim dt2 As fxDataSource
bd2.Groups.AddDef("bm") '根据车间分组
bd2.Groups.AddDef("date",DateGroupEnum.Year,"年度")
bd2.Groups.AddDef("DATE", "月份")
bd2.Totals.AddDef("完成情况_欠交金额", "未配套金额_当月")
bd2.Totals.AddDef("完成情况_欠交金额", "未配套金额_累计",True)
bd2.Totals.AddDef("qjjine", "部份配套金额_当月")
bd2.Totals.AddDef("qjjine", "部份配套金额_累计",True)
bd2.Filter = "[是否完成] = '否'or [PT] <> '是'"
dt2 = bd2.BuildDataSource()
Dim bd3 As New GroupTableBuilder("统计表3",DataTables("ER_SCJH"))
Dim dt3 As fxDataSource
bd3.Groups.AddDef("BM")
bd3.Groups.AddDef("DATE", DateGroupEnum.Year, "年份")
bd3.Groups.AddDef("DATE", "月度")
bd3.Totals.AddDef("完成情况_欠交金额", "合同欠交金额_当月")
bd3.Totals.AddDef("完成情况_欠交金额", "合同欠交金额_累计",True)
bd3.Filter = "[是否完成] = '否'" '对金额进行统计
dt3 = bd3.BuildDataSource()
dt1.Combine("bm",dt2,"bm")
DT1.COMBINE("DATE, 年份",dt2,"DATE, 年份") '("DATE",dt2,"date,年份")
dt1.combine("DATE, 月度",dt2, "DATE, 月度")
dt1.Combine("BM",dt3,"BM")
DT1.COMBINE("DATE, 年份",dt3,"DATE, 年份")
dt1.combine("DATE , 月度",dt3, "DATE ,月度")
Tables("窗口4_Table1").DataSource = dt1