Foxtable(狐表)用户栏目专家坐堂 → 删除符合的行


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

主题:删除符合的行

美女呀,离线,留言给我吧!
尽快
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:婴狐 帖子:2 积分:81 威望:0 精华:0 注册:2014/5/8 23:37:00
删除符合的行  发帖心情 Post By:2014/5/8 23:45:00 [只看该作者]

Dim bd1 As New GroupTableBuilder("统计",DataTables("账户"))
Dim dt1 As fxDataSource
bd1.FromServer = True
bd1.Groups.AddDef("账户名称")
bd1.Totals.AddDef("初始金额")
dt1 = bd1.BuildDataSource()

Dim Products As List(Of String)
Products = DataTables("账户").GetValues("账户名称")
For Each Product As String In Products
    Output.Show(Product)
Next

 

Dim bd2 As New GroupTableBuilder("统计表2",DataTables("流水账"))
Dim dt2  As fxDataSource
bd2.Filter = "[类别] ='支出'"
bd2.FromServer = True
bd2.Groups.AddDef("账户名称")
bd2.Totals.AddDef("金额","支出金额")
dt2 = bd2.BuildDataSource()

Dim bd3 As New GroupTableBuilder("统计表3",DataTables("流水账"))
Dim dt3 As fxDataSource
bd3.Filter = "[类别] = '收入'"
bd3.FromServer = True
bd3.Groups.AddDef("账户名称")
bd3.Totals.AddDef("金额","收入金额")
dt3 = bd3.BuildDataSource()

dt1.Combine("账户名称",dt2,"账户名称")
dt1.Combine("账户名称",dt3,"账户名称")
dt1.Show("统计")
DataTables("统计").DataCols.Add("余额",Gettype(Double),"( IIF( 初始金额 Is null,0,初始金额) -IIF( 支出金额 Is null,0, 支出金额) + IIF(收入金额 Is Null,0,收入金额))")

 

Dim Products As List(Of String)
Products = DataTables("账户").GetValues("账户名称")

 

现在的问题是我需要把统计表里”账户名称“ 不是 DataTables("账户"). 里的账户名称的行删除掉

希望哪位高手给下代码

[此贴子已经被作者于2014-5-8 23:46:24编辑过]

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


加好友 发短信
等级:贵宾 帖子:35433 积分:178524 威望:0 精华:3 注册:2013/3/30 16:36:00
  发帖心情 Post By:2014/5/9 8:47:00 [只看该作者]

dim zhmc as string =  DataTables("账户").GetComboListString("账户名称").replace("|","','")



Dim bd2 As New GroupTableBuilder("统计表2",DataTables("流水账"))
Dim dt2  As fxDataSource
bd2.Filter = "[类别] ='支出' 
and 账户名称 in ('" & zhmc  & "')"
bd2.FromServer = True
bd2.Groups.AddDef("账户名称") 
bd2.Totals.AddDef("金额","支出金额") 
dt2 = bd2.BuildDataSource()

Dim bd3 As New GroupTableBuilder("统计表3",DataTables("流水账"))
Dim dt3 As fxDataSource
bd3.Filter = "[类别] = '收入' and 
账户名称 in ('" & zhmc  & "')"

bd3.FromServer = True
bd3.Groups.AddDef("账户名称") 
bd3.Totals.AddDef("金额","收入金额") 
dt3 = bd3.BuildDataSource()

dt1.Combine("账户名称",dt2,"账户名称") 
dt1.Combine("账户名称",dt3,"账户名称") 
dt1.Show("统计") 
DataTables("统计").DataCols.Add("余额",Gettype(Double),"( IIF( 初始金额 Is null,0,初始金额) -IIF( 支出金额 Is null,0, 支出金额) + IIF(收入金额 Is Null,0,收入金额))")


 回到顶部