Click here to Skip to main content
15,890,845 members
Please Sign up or sign in to vote.
1.80/5 (2 votes)
See more:
I got user-defined type not defined compile error i have added the references
Crystal Reports ActiveX Designer Runtime Library still got the error


VB
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
Posted
Comments
Sergey Alexandrovich Kryukov 13-Feb-12 14:59pm    
I never understood what would be the reason of dealing with VB6 at all.
--SA
Christian Graus 13-Feb-12 16:39pm    
SA is right - VB6 is a nightmare. Any company that's not migrated to a real language by now, is probably not good to work for, and anyone learning VB6 now is being decieved.
thatraja 13-Feb-12 23:26pm    
What's the error?

Hi, have you tried adding Crystal Report Engine 8 Object Library?
 
Share this answer
 
VB
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
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900