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.