I have tested my program on my PC, and everything works OK, however when I attempt to Deploy the Windows Form Application to Client machine Crystal Reports Window pops up asking for PASSWORD, despit the fact that have set this using:
Dim cryRpt As New ReportDocument
Dim crtableLogoninfos As New TableLogOnInfos
Dim crtableLogoninfo As New TableLogOnInfo
Dim crConnectionInfo As New ConnectionInfo
Dim CrTables As Tables
Dim CrTable As Table
cryRpt.Load("C:\ActivityReport.rpt")
cryRpt.SetParameterValue("FromDate", TextBox1.Text)
cryRpt.SetParameterValue("ToDate", TextBox2.Text)
With crConnectionInfo
.ServerName = serverbox.Text
.DatabaseName = dbbox.Text
.UserID = userbox.Text
.Password = passwordbox.Text
End With
CrTables = cryRpt.Database.Tables
For Each CrTable In CrTables
crtableLogoninfo = CrTable.LogOnInfo
crtableLogoninfo.ConnectionInfo = crConnectionInfo
CrTable.ApplyLogOnInfo(crtableLogoninfo)
Next
CrystalReportViewer1.ReportSource = cryRpt
CrystalReportViewer1.Refresh()
I have also noticed that the DATABASE Field is Blank in the Crystal Reports Pop Up which would explain why I get the Error : LOGIN FAILED when inputting the password manually, but cant figure out why the Database Name is not being passed.
I have tried changing the DATABASE name on my form (ON DEV PC) which is in dbbox.text and this does stop the report from running so it should be passing the DATABASE as part of the Connection String?
I have installed Crystal Report Viewer on the Client machine as I though it may be this, but no luck. Do I need to install .NET v4 possibly ??
Really Stuck now, and would love a bit of guidance.
Thanks Rob