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.
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.
Thanx in advance to consider it seriously.
No one has replied yet! Why not be the first?
Sign in or Join us (it's free).