Foxtable(狐表)用户栏目专家坐堂 → [求助]统计排序问题


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

主题:[求助]统计排序问题

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


加好友 发短信
等级:幼狐 帖子:97 积分:870 威望:0 精华:0 注册:2016/9/27 14:05:00
[求助]统计排序问题  发帖心情 Post By:2016/11/9 17:01:00 [显示全部帖子]

在bd5里面有个“订单编号”,我想显示的时候排在第一列,要怎么改这个代码?



Dim bd1 As New GroupTableBuilder("统计表1",DataTables("板材用料表"))
Dim dt1 As fxDataSource
bd1.Groups.AddDef("产品编号") '根据型号分组
bd1.Totals.AddDef("金额","板材成本") '对数量进行统计
bd1.Decimals = 2
dt1 = bd1.BuildDataSource()


Dim bd2 As New GroupTableBuilder("统计表2",DataTables("包装箱板材用量"))
Dim dt2  As fxDataSource
bd2.Groups.AddDef("产品编号") '根据型号分组
bd2.Totals.AddDef("金额","包装箱板材成本") '对数量进行统计
bd2.Decimals = 2
dt2 = bd2.BuildDataSource()

Dim bd11 As New GroupTableBuilder("统计表11",DataTables("包装箱临时表"))
Dim dt11  As fxDataSource
bd11.Groups.AddDef("产品编号") '根据型号分组
bd11.Totals.AddDef("金额","包装箱估算") '对数量进行统计
bd11.Decimals = 2
dt11 = bd11.BuildDataSource()

Dim bd3 As New GroupTableBuilder("统计表3",DataTables("油漆用量表"))
Dim dt3  As fxDataSource
bd3.Groups.AddDef("产品编号") '根据型号分组
bd3.Totals.AddDef("单机金额","油漆成本") '对数量进行统计

bd3.Decimals = 2
dt3 = bd3.BuildDataSource()


Dim bd4 As New GroupTableBuilder("统计表4",DataTables("BOM表"))
Dim dt4  As fxDataSource
bd4.Groups.AddDef("产品编号") '根据型号分组

bd4.Totals.AddDef("金额","BOM成本") '对数量进行统计
bd4.Decimals = 2
dt4 = bd4.BuildDataSource()

Dim bd5 As New GroupTableBuilder("统计表5",DataTables("订单工时成本"))
Dim dt5  As fxDataSource
bd5.Filter = "[部门] = '木工'"
bd5.Groups.AddDef("产品编号") '根据型号分组
bd5.Groups.AddDef("订单编号")
bd5.Totals.AddDef("单位工时成本","工时成本_木工") '对数量进行统计
bd5.Decimals = 2
dt5 = bd5.BuildDataSource()

Dim bd6 As New GroupTableBuilder("统计表6",DataTables("订单工时成本"))
Dim dt6  As fxDataSource
bd6.Filter = "[部门] = '涂装'"
bd6.Groups.AddDef("产品编号") '根据型号分组
bd6.Totals.AddDef("单位工时成本","工时成本_涂装") '对数量进行统计
bd6.Decimals = 2
dt6 = bd6.BuildDataSource()

Dim bd7 As New GroupTableBuilder("统计表7",DataTables("订单工时成本"))
Dim dt7  As fxDataSource
bd7.Filter = "[部门] = '装配'"
bd7.Groups.AddDef("产品编号") '根据型号分组
bd7.Totals.AddDef("单位工时成本","工时成本_装配") '对数量进行统计
bd7.Decimals = 2
dt7 = bd7.BuildDataSource()

Dim bd8 As New GroupTableBuilder("统计表8",DataTables("订单工时成本"))
Dim dt8  As fxDataSource
bd8.Filter = "[部门] = '五金'"
bd8.Groups.AddDef("产品编号") '根据型号分组
bd8.Totals.AddDef("单位工时成本","工时成本_五金") '对数量进行统计
bd8.Decimals = 2
dt8 = bd8.BuildDataSource()

Dim bd9 As New GroupTableBuilder("统计表9",DataTables("订单工时成本"))
Dim dt9  As fxDataSource
bd9.Filter = "[部门] = '光电'"
bd9.Groups.AddDef("产品编号") '根据型号分组
bd9.Totals.AddDef("单位工时成本","工时成本_光电") '对数量进行统计
bd9.Decimals = 2
dt9 = bd9.BuildDataSource()

dt1.Combine("产品编号",dt2,"产品编号")

dt1.Combine("产品编号",dt11,"产品编号")
dt1.Combine("产品编号",dt3,"产品编号")
dt1.Combine("产品编号",dt4,"产品编号")

dt1.Combine("产品编号",dt5,"产品编号")
dt1.Combine("产品编号",dt6,"产品编号")
dt1.Combine("产品编号",dt7,"产品编号")
dt1.Combine("产品编号",dt8,"产品编号")
dt1.Combine("产品编号",dt9,"产品编号")


Tables("统计_Table1").DataSource = dt1

With DataTables("统计_Table1").DataCols
    .Add("工时成本_小计",Gettype(Double), "IsNull([工时成本_木工],0) + ISNULL([工时成本_涂装],0) + ISNULL([工时成本_装配],0)  + ISNULL([工时成本_五金],0)+ ISNULL([工时成本_光电],0)   ")
    
End With



With DataTables("统计_Table1").DataCols
    .Add("合计",Gettype(Double), "IsNull([板材成本],0) + iif([包装箱板材成本] is null,[包装箱估算],[包装箱板材成本]) + ISNULL([油漆成本],0)  + ISNULL([BOM成本],0)+ ISNULL([工时成本_小计],0)   ")
    
End With


For Each c As Col In Tables("统计_Table1").Cols
    c.TextAlign  = TextAlignEnum.Center
    If c.IsNumeric Then
        c.DataCol.SetFormat("0.00")
    End If
Next

 回到顶部
帅哥哟,离线,有人找我吗?
77611471
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:97 积分:870 威望:0 精华:0 注册:2016/9/27 14:05:00
  发帖心情 Post By:2016/11/9 17:28:00 [显示全部帖子]

谢谢!

 回到顶部