Foxtable(狐表)用户栏目专家坐堂 → combine后如何合并列


  共有2324人关注过本帖树形打印复制链接

主题:combine后如何合并列

帅哥哟,离线,有人找我吗?
snaker114
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:婴狐 帖子:44 积分:635 威望:0 精华:0 注册:2018/4/8 14:05:00
combine后如何合并列  发帖心情 Post By:2018/6/3 1:01:00 [显示全部帖子]

老师,下面的代码怎么改能将表1变为表2?


Dim bd1 As New CrossTableBuilder("统计表1",DataTables("月销售计划"))
Dim dt1 As fxDataSource
bd1.HGroups.AddDef("所属省份") '根据型号分组
bd1.VGroups.AddDef("所属月份","{0}月_计划") '根据型号分组
bd1.Totals.AddDef("计划销售","计划_{0}月") '对数量进行统计
dt1 = bd1.BuildDataSource()

Dim bd2 As New CrossTableBuilder("统计表3",DataTables("销售订单序时簿"))
Dim dt2  As fxDataSource
bd2.HGroups.AddDef("所属省份") '根据型号分组
bd2.VGroups.AddDef("日期","{0}月_实际") '根据型号分组
bd2.Totals.AddDef("价税合计","{0}月_实际") '对数量进行统计
dt2 = bd2.BuildDataSource()

dt1.Combine("所属省份",dt2,"所属省份") '将销售统计数据组合到进货统计数据
Tables("窗口7_Table1").DataSource = dt1 '将统计结果绑定到Table

表1

1月2月3月4月5月6月7月8月9月10月11月12月1月2月3月4月5月6月7月8月9月10月11月12月
计划计划计划计划计划计划计划计划计划计划计划计划实际实际实际实际实际实际实际实际实际实际实际实际
安徽省8.2783.920714.396616.52310.7957.6812.01926.59236.63533.81274.934114.413169380838507468075950704256208060136714007415544090111270125700
北京市63.663728.731749.109153.071636.780913.054817.511118.424818.567220.935236.182543.967617867517292197315213116149253.24298125182235272839.88218489.88180120497996.73369281.5
福建省2.624817.20199.43548.96864.587318.02423.772517.89717.930914.95593.157723.4443603257666084150275535128860634861182199322086480166415133975264521.5
甘肃省18.402511.970516.926740.53792.1459.36258.503217.554816.69198.454515.07717.3735686108927020980011507091850103750582001323505510090600128100311751
广东省58.680159.94166.06103.294.84846.661957.099254.959.2135.5174.5349.2698441270108000573902912492527601591340579629621434738031588462892230629686
广西省0.933.3914.185.9501.823.49923.4553.122.381.279844002203452053500233003100353001290019650302501542043455
贵州省24.813829.229949.320711.898342.230323.345315.667322.967615.59821.795321.646840858104415199650270685198784267500103790178860235620159920155415353245
海南省3.513910.002310.669421.946.98618.655112.845911.7739.5710.6398.898611.50673157253100827701069301420501073108250268730180240194720111550179160
河北省38.381449.375555.6511109.21925.195437.20844.147746.489947.9846.279734.963935.1084429748255599312108543586391076594650204056297658.2327658342370471079829410.1
河南省86.878576.5993111.3162149.224737.575576.962671.149267.8758.5678.327264.2871.2567671637.5329660415494442992.552605554811557826050411063109286751713557481514910.5
黑龙江14.56913.381814.513716.24710.076.2529.25989.30458.42147.01329.17965.7878
湖北省14.52415.957119.251153.62275.55456.4621.980922.75327.010922.550810.577813.7572102514146600182592123870966501608651900504796510340293500130550429680
湖南省47.614265.981165.9747114.431441.855166.233653.583442.945933.370837.540953.995256.4738502533390160618362604312549694419248397664357081561208422920593706929144


表2:   4-12月就不画了

1月2月3月
计划实际计划实际计划实际
安徽省8.278693803.92078385014.396674680
北京市63.663717867528.731717292149.109197315
福建省2.62486032517.2019766609.43584150
甘肃省18.40256861011.97058927016.9267209800
广东省58.680144127059.94110800066.06573902
广西省0.9344003.3912204.1834520
贵州省4085824.813810441529.2299199650
海南省3.51393157210.00235310010.669482770
河北省38.381442974849.375525559955.6511312108
河南省86.8785671637.576.5993329660111.3162415494
黑龙江14.56913.381814.5137







 回到顶部