使用vb6应用程序的Crystal报表 [英] Crystal report with vb6 application
本文介绍了使用vb6应用程序的Crystal报表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我得到了用户定义的类型未定义编译错误我添加了引用
Crystal Reports ActiveX Designer运行时库仍然出现错误
I got user-defined type not defined compile error i have added the references
Crystal Reports ActiveX Designer Runtime Library still got the error
Public Sub ShowReport(cRptFile As String, cDBName As String, crxReport As CRAXDRT.Report)
Dim crxApplication As New CRAXDRT.Application
Dim crxDatabaseTable As CRAXDRT.DatabaseTable
Dim crxParameterField As CRAXDRT.ParameterFieldDefinition
Dim crxFormulaField As CRAXDRT.FormulaFieldDefinition
Set crxReport = crxApplication.OpenReport(DevelopmentStatus("reports") & cRptFile, 1)
For Each crxDatabaseTable In crxReport.Database.Tables
crxDatabaseTable.Location = DevelopmentStatus("data") & cDBName
Next crxDatabaseTable
frmCrxVw.Show
frmCrxVw.CRViewer1.ReportSource = crxReport
frmCrxVw.CRViewer1.ViewReport
Set crxFormulaField = Nothing
Set crxParameterField = Nothing
Set crxDatabaseTable = Nothing
Set crxReport = Nothing
crxApplication.CanClose
Set crxApplication = Nothing
End Sub
推荐答案
您好,您是否尝试过添加 Crystal Report Engine 8对象库?
Hi, have you tried adding Crystal Report Engine 8 Object Library?
Private Sub Command2_Click()
Dim sqlString As String
sqlString = "Select * From detail WHERE code = cint('" & Combo1.Text & "') and s_date >= datevalue('" & DTPicker1.Value & "') and s_date <= datevalue('" & DTPicker2.Value & "') order by s_date"
' Get the data into a recordset.
Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient
rs.Open sqlString, cn, adOpenStatic, adLockOptimistic
' Bind the recordset to the grid.
'Set grdEmployees.DataSource = rs
Set DataGrid1.DataSource = rs
End Sub
这篇关于使用vb6应用程序的Crystal报表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文