http://www.wzjcw.net/vbgood/taishan/index.html有代码可以参考

解决方案 »

  1.   

    如果是SQL 语句查询的话,修改Where 字句不就可以了.
      

  2.   

    有两个dtptricker 控件,选定时间范围,用此条件更新报表
    Private Sub cmdnewsearch_Click()
    If DataEnvironment1.rsCommandnew.State <> adStateClosed Then
        DataEnvironment1.rsCommandnew.Close
    End If
    DataEnvironment1.Commands.Item(2).CommandText = "Select * from dbo.select_new where fixdate between" & "'" & DTPnewmeter1.Value & "'" & "and" & "'" & DTPnewmeter2.Value & "'"With DataGridnew
    Set .DataSource = DataEnvironment1
    .DataMember = "commandnew"end sub 
    可是报表显示的还是以前的数据
      

  3.   

    DataEnvironment1.Commands.Item(2).Execute
      

  4.   

    我的报表先绑定到了视图了,现在用.execute 提示有错