0
votes

My windows application has an embedded crystal report viewer , where as the viewer works well in the developer machine.

Developer machine has : SAP Crystal Reports , version for Visual Studio 2010 SAP Crystal Reports runtime engine for .net framework 4 (32 bit)

My client machine has : SAP Crystal Reports runtime engine for .net framework 4 (32 bit) Ms .net framework 4 Extended and client

I compiled my application in x86 environment. I copied the release folder to the client machine and the application freezes when the crystal report viewer form is opened. It works well in all developer machines.

My code is :

Public Sub retreiveReceiptReport()
    Dim myConnection As New OdbcConnection
    myConnection.ConnectionString = "driver={mysql odbc 3.51 driver};server=localhost;port=3307;database=aiga;uid=root;pwd=vision18"
    Dim MyCommand As New OdbcCommand
    MyCommand.Connection = myConnection
    MyCommand.CommandText = "select amount, payment_mode, receipt_no, registrarUsername, payment_from, purpose, DATE_FORMAT(receipt_date, '%d-%m-%Y') as receipt_date , tagged_to from aiga_trn_treceipt where registrarUsername = '" & main.reguserName & "' order by receipt_no desc limit 1 "
    MyCommand.CommandType = Data.CommandType.Text
    Dim MyDA As New OdbcDataAdapter
    MyDA.SelectCommand = MyCommand
    Dim myDS As New DataSet
    MyDA.Fill(myDS, "DataTable2")

    MyCommand.CommandText = "SELECT * FROM aiga.aiga_trn_registrar a where registrarUsername ='" & main.reguserName & "'"
    MyCommand.CommandType = Data.CommandType.Text
    MyDA.SelectCommand = MyCommand
    MyDA.Fill(myDS, "DataTable3")

    Dim oRpt As New ReportDocument
    Dim path As String = My.Application.Info.DirectoryPath
    oRpt.Load(path + "\receiptFormat.rpt")
    oRpt.SetDataSource(myDS)
    receiptReportViewer.ReportSource = oRpt
End Sub

I did an unit testing . Result: Single windows form with crystalreportviewer control works well. If there is a navigation from one windows form to another windows form, the issue persists on the newly opened form.

1
Two things: There are about 10 versions of CR for VS2010; make sure you install the same version runtime on the client as your developer machine... secondly, you should be checking that the file exists before you load it... it could be the path is incorrect.Paul Zahra
I've removed the C# tag as this is clearly VB.Paul Zahra
My suggestion with these type of issues is to run ProcMon if you can on the client's computer and see what it is missing. From there on you can potentially identify what is missing and needs to be installed still.Bernd Linde
@BerndLinde "Query not found" in status of ProcmonSriman Reddy
Was it a file or registry entry that was not found at the point of failure? If it was a file, check where that file should be coming from and what you might need to installBernd Linde

1 Answers

3
votes

Have you installed Crystal runtime for visual studio 2010 on the client? Try installing both x86 and x64 versions. Pay particular attention to the deployment section of the wiki.