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


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

主题:[求助] 请帮帮我

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


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

 

Dim a As Date=Vars("mydate")
Dim b As String=a.Year
Dim c As String=a.Month
Dim d As String=a.Day

Dim bd1 As New GroupTableBuilder("统计表1",DataTables("fdc"))
Dim dt1 As fxDataSource
bd1.Groups.AddDef("ch")
bd1.Totals.AddDef("cs")

bd1.Totals.AddDef("je")
bd1.Filter="[rq] > #(b & "-" & c & "-" & d)#"             按日期筛选

 

运行到上一句就出错


dt1 = bd1.BuildDataSource()

Dim bd2 As New GroupTableBuilder("统计表2",DataTables("jyb"))
Dim dt2  As fxDataSource
bd2.Groups.AddDef("ch")
bd2.Totals.AddDef("yl")
bd2.Totals.Adddef("je","金额")
bd2.Filter="[rq] > #2011-11-30#"
dt2 = bd2.BuildDataSource()

 

dt1.Combine("ch",dt2,"ch")
dt1.Show("统计表1")
 
Tables("统计表1").Sort = "ch"
DataTables("统计表1").DataCols("je").SetFormat ("0.00")
DataTables("统计表1").DataCols("yl").SetFormat ("0")
DataTables("统计表1").DataCols("金额").SetFormat ("0.00")
DataTables("统计表1").DataCols.Add("应付款", Gettype(Single), "[je] - [金额]")
DataTables("统计表1").DataCols("应付款").SetFormat ("0.00")
Tables("统计表1").SetColVisibleWidth("ch|60|cs|60|je|80|yl|70|金额|80|应付款|80")

MainTable = Tables("统计表1")


Dim t As Table = Tables("统计表1")
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 15:22:59编辑过]

 回到顶部