以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [求助][讨论]在窗口中多表按时间统计资金进出 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=77375) |
-- 作者:18929005187 -- 发布时间:2015/11/17 13:41:00 -- [求助][讨论]在窗口中多表按时间统计资金进出 小弟参考 http://www.foxtable.com/help/index.html?n=0982.htm 一直出错说日期不存在 Dim bd1 As New GroupTableBuilder("统计表1",DataTables("工资详情")) Dim dt1 As fxDataSource bd1.Groups.AddDef("日期",DateGroupEnum.Year,"年") \'添加日期列用于分组,并用"年"代替原名称 bd1.Groups.AddDef("日期","月") bd1.Totals.AddDef("工资日计","工资_总金额") \'对金额进行统计 dt1 = bd1.BuildDataSource() Dim bd2 As New GroupTableBuilder("统计表2",DataTables("员工支出表")) Dim dt2 As fxDataSource bd2.Groups.AddDef("日期",DateGroupEnum.Year,"年") \'添加日期列用于分组,并用"年"代替原名称 bd2.Groups.AddDef("日期","月") bd2.Totals.AddDef("金额","工资_预支金额") \'对金额进行统计 dt2 = bd2.BuildDataSource() Dim bd3 As New GroupTableBuilder("统计表3",DataTables("出货详情")) Dim dt3 As fxDataSource bd3.Groups.AddDef("日期",DateGroupEnum.Year,"年") \'添加日期列用于分组,并用"年"代替原名称 bd3.Groups.AddDef("日期","月") bd3.Totals.AddDef("订单金额","出货_总金额") \'对金额进行统计 bd3.Totals.AddDef("已收款","出货_已收金额") \'对金额进行统计 bd3.Totals.AddDef("欠款","出货_待收款") \'对金额进行统计 dt3 = bd3.BuildDataSource() Dim bd4 As New GroupTableBuilder("统计表4",DataTables("购货详情")) Dim dt4 As fxDataSource bd4.Groups.AddDef("日期",DateGroupEnum.Year,"年") \'添加日期列用于分组,并用"年"代替原名称 bd4.Groups.AddDef("日期","月") bd4.Totals.AddDef("购货金额","购货_总金额") \'对金额进行统计 bd4.Totals.AddDef("已付款","购货_已付金额") \'对金额进行统计 bd4.Totals.AddDef("待付款","购货_待付金额") \'对金额进行统计 dt4 = bd4.BuildDataSource() Dim bd5 As New GroupTableBuilder("统计表5",DataTables("木材表")) Dim dt5 As fxDataSource bd5.Groups.AddDef("日期",DateGroupEnum.Year,"年") \'添加日期列用于分组,并用"年"代替原名称 bd5.Groups.AddDef("日期","月") bd5.Totals.AddDef("总价","木材_总金额") \'对金额进行统计 bd5.Totals.AddDef("已付款","木材_已付金额") \'对金额进行统计 bd5.Totals.AddDef("欠款","木材_待付金额") \'对金额进行统计 dt5 = bd5.BuildDataSource() Dim bd6 As New GroupTableBuilder("统计表6",DataTables("工厂杂项进出")) Dim dt6 As fxDataSource bd6.Groups.AddDef("日期",DateGroupEnum.Year,"年") \'添加日期列用于分组,并用"年"代替原名称 bd6.Groups.AddDef("日期","月") bd6.Totals.AddDef("支出金额","工厂杂项_支出金额") \'对金额进行统计 bd6.Totals.AddDef("收益金额","工厂杂项_收益金额") \'对金额进行统计 dt6 = bd6.BuildDataSource() Dim bd7 As New GroupTableBuilder("统计表7",DataTables("借贷款明细")) Dim dt7 As fxDataSource bd7.Groups.AddDef("日期",DateGroupEnum.Year,"年") \'添加日期列用于分组,并用"年"代替原名称 bd7.Groups.AddDef("日期","月") bd7.Totals.AddDef("借款金额","借贷款明细_借出金额") \'对金额进行统计 bd7.Totals.AddDef("还款金额","借贷款明细_还款金额") \'对金额进行统计 dt7 = bd7.BuildDataSource() Dim nms As String() = {"日期","日期"} \'指定连接列 dt1.Combine(nms,dt2,nms) \' dt1.Combine(nms,dt3,nms) \' dt1.Combine(nms,dt4,nms) dt1.Combine(nms,dt5,nms) dt1.Combine(nms,dt6,nms) dt1.Combine(nms,dt7,nms) Tables("主窗体_Table1").DataSource = dt1 \'将统计结果绑定到Table With DataTables("主窗体_Table1").DataCols \'用表达式列计算库存数据 .Add("应付工资",Gettype(Integer), "IsNull([工资_总金额],0) - ISNULL([工资_预支金额],0)") End With 请告知错误在哪里 [此贴子已经被作者于2015/11/17 13:46:55编辑过]
|
-- 作者:大红袍 -- 发布时间:2015/11/17 14:27:00 -- Dim nms As String() = {"日期","日期"} \'指定连接列
改成
Dim nms As String() = {"年","月"} \'指定连接列 |