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