1
votes

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

1
If it Helps here is a Screenshot of my Application Running showing the Error I have described: ERROR MESSAGE CLICK HERE - Rob4236

1 Answers

0
votes

I just use:

 crDocument.SetDatabaseLogon("name", "password", "server", "database")

I've avoided those issues simply using that instead of all of that above code you have. I've ran into the same issues and it drove me crazy.

Someone here probably knows why, but what I posted above, works for me.