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 '自动设置所有列的宽度