borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2010 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Invalid Report Source)Next Topic (Passing Param frm 1 subreport to other subrepot) New Topic New Poll Post Reply
AndreaVB Forum : Reporting tools : error running crystal report
Poster Message
VYX
Level: Professor


Registered: 16-12-2005
Posts: 77

Ads by Lake Quincy Media
icon error running crystal report

im using windows xp
crystal report 8.5 developer edition
microsoft activex 2.5


my problem when i run this to other computer no crystal report and vb6 but i made a package. i already added all required files inlcuding crviewer.dll

--the program GUI's works but when i run the report shows error message physical database not found and cant create active x library something like that

please help me out to this code.
it works in my computer installed crystal report 8.5 and vb6


i make an installer  but
Function InitCrystalReportFilter(ByVal vSQl As String, ByVal vRptFileName As String, vReportName As String, vReportTitle As String)
    

Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
CONNECT cn, rs, vSQl
If rs.RecordCount > 0 Then



   Dim CrxApp As CRAXDRT.Application
    Dim CrxRep As CRAXDRT.Report
    Dim crxDatabase As CRAXDRT.Database
    Dim crxDatabaseTables As CRAXDRT.DatabaseTables
    Dim crxDatabaseTable As CRAXDRT.DatabaseTable

    Set CrxApp = New CRAXDRT.Application
    Set CrxRep = CrxApp.OpenReport(vRptLocation & "\" & vRptFileName & ".rpt")
    
    Set crxDatabase = CrxRep.Database
    Set crxDatabaseTables = crxDatabase.Tables
    
    
    If vMOdeSQLMYSQL = 0 Or vMOdeSQLMYSQL = 1 Then ''sql server mysql
        For Each crxDatabaseTable In crxDatabaseTables
    
        Call crxDatabaseTable.SetLogOnInfo(vSErverName, vDBName, vDBUserID, vDBPW)
        crxDatabaseTable.Location = crxDatabaseTable.name ''this will locate your server if ever it was moved to another dbase or server
        
        
        With CrxRep
        .SQLQueryString = vSQl


        End With
    
    
        
    
        crView.EnableExportButton = True
        crView.DisplayGroupTree = False
        crView.EnableAnimationCtrl = False ''disable crystal report logo show
        crView.EnableCloseButton = True
        
  
        With crView
            
            .ReportSource = CrxRep
                .ViewReport
                .Zoom 90
            
            While .IsBusy
                DoEvents
            Wend
            .visible = False
            .Refresh
        End With
    
    
    
    Set CrxApp = Nothing
    Set CrxRep = Nothing

    disconnect cn, rs
    
    Me.Caption = vReportName & " - " & vRptFileName

On Error Resume Next
    Me.Show 1

    Exit Function

Else
    MsgBox "No record found to Print !", 16, vMsgboxTitle
    
End If


ERRS:

If Err.Number <> 0 Then

    'MsgBox Err.Number & " : " & Err.Description & vbCrLf & " Please check the report file in report folder location if Exist otherwise please contact the Developer !", 16, "Reporting Error"
    Set CrxApp = Nothing
    Set CrxRep = Nothing
    

    
End If

End Function


guys please help me fix this..

[Edited by VYX on 10-08-2010 at 03:48 PM GMT]

10-08-2010 at 05:16 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : Reporting tools : error running crystal report
Previous Topic (Invalid Report Source)Next Topic (Passing Param frm 1 subreport to other subrepot) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2010 Andrea Tincaniborder