VB中怎样用报表打印查询出来的数据

来源:百度知道 编辑:UC知道 时间:2024/05/28 02:32:55
我用ADO连接的数据库,我现在可以从数据库中查询出来我需要的资料,也能把数据在DATAGRID中显示出来,但是用报表打印不出来,打出来的还是数据库的全部内容,不知道为什么?以下是我的程序,请高手指点一下哪里有问题。万分感谢!
Private Sub chaxun _Click()
Adodc1.RecordSource = "select * from js where 姓名='" & Form2.Text1.Text & " '"
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
DataGrid1.Refresh
End Sub
Private Sub dayin_Click()
Set DataReport2.DataSource = Adodc1
DataReport2.Refresh
Unload DataEnvironment2
Unload DataReport2
'DataGrid1.Refresh
DataReport2.Show

直接用记录集导出XLS吧

提这种等级的问题,一般分数在300分以上,人家才肯讲。
因为VB报表打印技术学会了,可以卖钱。

就是,这么专业的知识,分少了都没有人答,谁闲的无聊陪你玩啊。

0分也来问这个问题?