Crystal Report Database Login Error

Muhammad Kashif

New member
Joined
Jul 11, 2008
Messages
1
Programming Experience
3-5
I created a project in VB .Net and used Crystal Reports for Visual Studio 2005 for reporting purpose.

I made setup of the project. When I run setup on my system reports run smoothly but when i run it on another computer reports displays Databes Login Dialog Box and requires username and password; I attached the Dialog Box which appears.

I used stored procedure for my reports
and used login information and passed parameters as follows.


VB.NET:
Dim _Report As New rptReport_Documnet1 
Try 

                   Dim crTable As CrystalDecisions.CrystalReports.Engine.Table 
                   Dim crTableLogonInfo As CrystalDecisions.Shared.TableLogOnInfo 
                   Dim ConnInfo As New CrystalDecisions.Shared.ConnectionInfo() 

                   ConnInfo.ServerName = "pms-mahmad\sql2005" 
                   ConnInfo.DatabaseName = "QHSE" 
                   ConnInfo.UserID = "sa" 
                   ConnInfo.Password = "sa2008" 

                   For Each crTable In _Report.Database.Tables 
                       crTableLogonInfo = crTable.LogOnInfo 
                       crTableLogonInfo.ConnectionInfo = ConnInfo 
                       crTable.ApplyLogOnInfo(crTableLogonInfo) 
                   Next 
                   Dim PFsPolicyNo As ParameterFields = CType(_Report, ReportDocument).ParameterFields 
                     
                   Dim paramDiscreteValue As New ParameterDiscreteValue 
                   paramDiscreteValue.Value = paramValue 
                   paramField.CurrentValues.Add(paramDiscreteValue) 

                   crViewer.ReportSource = _Report 
Catch ex As Exception 
       Throw ex 
End Try

Even then i receive Database Login Dialog Box.:confused:

Thanx in advance To reply this.
 

Attachments

  • Error.gif
    Error.gif
    11.2 KB · Views: 23
What database is your report built from? I ran into a similar situation where I built the report from an Access database, then I upsized my database to SQLServer; but, my reports where pointing to Access. Even though in my code I told what data source to use I kept getting the login error. Then I refreshed the data source on my report (using SetDataSource) and then it worked.
 
Back
Top