以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 汇总统计不行,请给指点下 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=177197) |
-- 作者:chz007 -- 发布时间:2022/5/12 16:09:00 -- 汇总统计不行,请给指点下 Dim ny As WinForm.ComboBox = e.Form.Controls("年月") Dim hnm As WinForm.TextBox = e.Form.Controls("行内码") Dim tj As String = " [_identify] > 0" If ny.Text <> "" Then tj = tj & " and 年月 like \'%" & ny.Text & "%\'" End If 下面的代码不行,给指点下 DataTables("设备维修登记").LoadFilter=tj DataTables("设备维修登记").Load \' Dim tb1 As WinForm.Table = e.Form.Controls("Table1") tb1.Table.DataSource =tj Dim g As New GroupTableBuilder("设备维修汇总",tj) g.Groups.AddDef("年月") g.Totals.AddDef("给医院报价", AggregateEnum.sum, "给医院报价") g.Totals.AddDef("厂家报价", AggregateEnum.sum, "厂家报价") g.Totals.AddDef("差价", AggregateEnum.sum, "利润") g.Build() \'MainTable = Tables("设备维修汇总") tb1.Table.datasource = DataTables("设备维修汇总") tb1.Table.Cols("给医院报价").GrandTotal = True tb1.Table.Cols("厂家报价").GrandTotal = True tb1.Table.Cols("利润").GrandTotal = True tb1.Table.GrandTotal = True \'显示合计模式 tb1.Table.AutoSizeCols \'自动设置所有列的宽度
|
-- 作者:有点蓝 -- 发布时间:2022/5/12 16:18:00 -- DataTables("设备维修登记").LoadFilter = tj DataTables("设备维修登记").Load Dim g As New GroupTableBuilder("统计表", DataTables("设备维修登记")) g.Groups.AddDef("年月") g.Totals.AddDef("给医院报价", AggregateEnum.sum, "给医院报价") g.Totals.AddDef("厂家报价", AggregateEnum.sum, "厂家报价") g.Totals.AddDef("差价", AggregateEnum.sum, "利润") Dim tb1 As WinForm.Table = e.Form.Controls("Table1") tb1.Table.datasource = g.BuildDataSource() tb1.Table.Cols("给医院报价").GrandTotal = True tb1.Table.Cols("厂家报价").GrandTotal = True tb1.Table.Cols("利润").GrandTotal = True tb1.Table.GrandTotal = True \'显示合计模式 tb1.Table.AutoSizeCols \'自动设置所有列的宽度 |
-- 作者:chz007 -- 发布时间:2022/5/12 16:26:00 -- 谢谢 |