Dim Filter As String = "" Dim Val As String = Forms("窗口2").Controls("TextBox1").Value if Val is nothing then MessageBox.Show("对不起,请先输入查找内容!", "提示") Else For each c As col In CurrentTable.Cols If c.IsString Then If Filter > "" Then Filter = Filter & " Or " End If Filter = Filter & c.Name & " Like '*" & Val & "*'" End If Next CurrentTable.Filter = Filter
if CurrentTable.Rows.Count-1 >= 0 Then Dim t As Table = Tables("销售明细") Dim g As SubtotalGroup t.SubtotalGroups.Clear() t.GroupAboveData = False t.TreeVisible = False g = New SubtotalGroup g.Aggregate = AggregateEnum.Sum g.GroupOn = "*" g.TotalOn = "数量,金额" g.Caption = "总计" t.SubtotalGroups.Add(g) t.Subtotal()
Dim dst1 As WinForm.DataList = Forms("窗口2").Controls("DataList1") dst1.ColumnList=("ID|日期|年|月|日|商品名称|规格|单位|数量|金额|客户|经手人") dst1.Filter = CurrentTable.Filter dst1.DataTable = DataTables("销售明细") dst1.Build() dst1.GrandTotal(AggregateEnum.Sum,"合计","数量","金额")
Else MessageBox.Show("对不起,没有符合条件的数据!", "提示") End If end if