Foxtable(狐表)用户栏目专家坐堂 → [求助] 请帮帮我


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

主题:[求助] 请帮帮我

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


加好友 发短信
等级:婴狐 帖子:12 积分:208 威望:0 精华:0 注册:2010/5/29 23:24:00
[求助] 请帮帮我  发帖心情 Post By:2012/4/6 19:14:00 [显示全部帖子]

Dim bd1 As New SQLGroupTableBuilder("翻斗车汇总表","fdc")
Dim dt1 As fxDataSource
bd1.Groups.AddDef("ch") '对车号分组
bd1.Totals.AddDef("cs") '对车数进行统计
bd1.Totals.AddExp("je","cs * dj * Parent(b).fl","金额") '对金额进行统计

 

运行到上一句错

 

 


bd1.Filter="[rq] >= #" & Vars("mydate") & "# and [rq] <= #" & Vars("mydate1") & "# "
dt1 = bd1.BuildDataSource()

Dim bd2 As New SQLGroupTableBuilder("统计表2","jyb")
Dim dt2  As fxDataSource
bd2.Groups.AddDef("ch") '根据车号分组
bd2.Totals.AddDef("yl","柴油") '对柴油进行统计
bd2.Totals.AddExp("je","yl*dj","油款") '对油款进行统计
bd2.Filter="[rq] >= #" & Vars("mydate") & "# and [rq] <= #" & Vars("mydate1") & "# "
dt2 = bd2.BuildDataSource()

dt1.Combine("ch",dt2,"ch")

dt1.Show("翻斗车汇总表") '显示统计结果

Tables("翻斗车汇总表").Sort = "ch"
DataTables("翻斗车汇总表").DataCols("je").SetFormat ("0.00")
DataTables("翻斗车汇总表").DataCols("yl").SetFormat ("0")
DataTables("翻斗车汇总表").DataCols("金额").SetFormat ("0.00")
DataTables("翻斗车汇总表").DataCols.Add("应付款", Gettype(Single), "[je] - [金额]")
DataTables("翻斗车汇总表").DataCols("应付款").SetFormat ("0.00")
Tables("翻斗车汇总表").SetColVisibleWidth("ch|60|cs|60|je|80|yl|70|金额|80|应付款|80")

MainTable = Tables("翻斗车汇总表")


Dim t As Table = Tables("翻斗车汇总表")
Dim g As Subtotalgroup
t.SubtotalGroups.Clear()
t.GroupAboveData = True
t.TreeVisible = True
t.SpillNode = True

g = New Subtotalgroup
g.Aggregate = AggregateEnum.Sum
g.GroupOn = "*"
g.TotalOn = "cs,je,yl,金额,应付款"
g.Caption = "总计"
t.SubtotalGroups.Add(g)

t.Subtotal()

[此贴子已经被作者于2012-4-6 21:06:31编辑过]

 回到顶部