以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 统计表生成的问题 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=48507) |
-- 作者:bagabaga -- 发布时间:2014/3/30 20:34:00 -- 统计表生成的问题 \'用SQL语句生成临时表 Dim cmd As New SQLCommand Dim dt As DataTable \'cmd.C cmd.CommandText = "SELECT 科目, 项目名称 , 合计 , 用户 FROM {项目费用表} WHERE 合计 < 0 And 用户 = \'工程\'" dt = cmd.ExecuteReader() \'对临时进行分组统计 Dim b As New GroupTableBuilder("统计表", dt) b.Groups.AddDef("用户") b.Groups.AddDef("科目") b.Groups.AddDef("项目名称") b.GrandProportion = True B.SubtotalLevel = 2 \'只生成总计行 b.Build() MainTable = Tables("统计表") 以上代码怎么不生成合计,b.GrandProportion = True 也没看到 请教
|
-- 作者:bagabaga -- 发布时间:2014/3/30 20:35:00 -- \'用SQL语句生成临时表 Dim cmd As New SQLCommand Dim dt As DataTable \'cmd.C cmd.CommandText = "SELECT 科目, 项目名称 , 合计 , 用户 FROM {项目费用表} WHERE 合计 < 0 And 用户 = \'工程\'" dt = cmd.ExecuteReader() \'对临时进行分组统计 Dim b As New GroupTableBuilder("统计表", dt) b.Groups.AddDef("用户") b.Groups.AddDef("科目") b.Groups.AddDef("项目名称") b.Groups.AddDef("合计") b.GrandProportion = True B.SubtotalLevel = 2 \'只生成总计行 b.Build() MainTable = Tables("统计表")
|
-- 作者:有点甜 -- 发布时间:2014/3/30 20:40:00 -- 是汇总模式么?
http://www.foxtable.com/help/topics/2669.htm
b.Subtotal = True \'生成汇总模式 |
-- 作者:bagabaga -- 发布时间:2014/3/30 20:49:00 -- Dim b As New GroupTableBuilder("统计表", dt) b.Groups.AddDef("用户") b.Groups.AddDef("科目") b.Groups.AddDef("项目名称") b.Groups.AddDef("合计") b.GrandProportion = True b.Subtotal = True \'生成汇总模式 出现索引出现负值,出错
|
-- 作者:有点甜 -- 发布时间:2014/3/30 21:16:00 -- 呃,你没有统计任意一列啊!你的是不是这个意思?
Dim cmd As New SQLCommand
Dim dt As DataTable
\'cmd.C
cmd.CommandText = "SELECT 科目, 项目名称 , 合计 , 用户 FROM {项目费用表} WHERE 合计 < 0 And 用户 = \'工程\'"
dt = cmd.ExecuteReader()
\'对临时进行分组统计
Dim b As New GroupTableBuilder("统计表", dt)
b.Groups.AddDef("用户")
b.Groups.AddDef("科目")
b.Groups.AddDef("项目名称")
b.Totals.AddDef("合计")
b.GrandProportion = True
b.Subtotal = True \'生成汇总模式
B.SubtotalLevel = 2 \'只生成总计行
b.Build()
MainTable = Tables("统计表")
|