如果用水晶报表:Private Sub Command1_Click()
Dim Report As New CrystalReport1
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim Str As String
Dim Serch As String
Serch = Text1.Text
Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset
Str = "select * from output where 购买公司 = '" & Serch & " '"
cn.Open "Provider=Microsoft.Jet.OLEDB.3.51;" & "Persist Security Info=False;" & "Data Source=" & App.Path & "\Sql\database.mdb"
rs.Open Str, cn
Report.Database.SetDataSource rs
Form13.CRViewer1.ReportSource = Report
Form13.CRViewer1.ViewReport
Form13.CRViewer1.ShowFirstPage
Form13.Show
rs.Close
Unload Me
End Sub其实 不管怎样打印只要 把记录集 想办法搞出来就行了
Dim Report As New CrystalReport1
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim Str As String
Dim Serch As String
Serch = Text1.Text
Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset
Str = "select * from output where 购买公司 = '" & Serch & " '"
cn.Open "Provider=Microsoft.Jet.OLEDB.3.51;" & "Persist Security Info=False;" & "Data Source=" & App.Path & "\Sql\database.mdb"
rs.Open Str, cn
Report.Database.SetDataSource rs
Form13.CRViewer1.ReportSource = Report
Form13.CRViewer1.ViewReport
Form13.CRViewer1.ShowFirstPage
Form13.Show
rs.Close
Unload Me
End Sub其实 不管怎样打印只要 把记录集 想办法搞出来就行了
解决方案 »
- html中链接到别的盘的文件的问题
- 函数调用问题
- 注册表的怪问题!!!
- 为什么我的Ftp控件只能上传一个文件
- 在客户端使用sql语句把Access中的表格导入到SQL server中,如何实现?
- 各位师兄:请推荐一本关于vb的入门与精通方面的好书
- 如何控制声道的转换。最起码要实现左声道、右声道、和立体声三种转换。比如看VCD时,左右声道是两种语言。就好像国语和粤语。用的是mmcontrol多媒体控件。最好写出代码。
- 问大家几个有关sql server的问题。
- 请问哪里有免费的仿WORD控件下载
- 求关于ip网络性能测试的范例程序
- 以下数据检索如何表达(SQL语句)请看,急.........
- 怎样才能获得系统的CPU的ID号、网卡MAC之类的系统信息(要代码)(100分)
dataenvironment里面的recordsouce用cmdtext写得SQL语句中,条件部分用特殊字符代替(比如"?")
程序中用replace语句把"?"替换成你的条件语句即可