Problem with crystal report

Results 1 to 2 of 2

Thread: Problem with crystal report

  1. #1
    Join Date
    Dec 1969

    Default Problem with crystal report

    Hi,<BR><BR>I am using crystal report viewer in my page.Here is my code.<BR><BR> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<BR><BR><BR> CrystalReportViewer1.ReportSource = Server.MapPath("crystalreport1.rpt")<BR><BR> CrystalReportViewer1.LogOnInfo.Item(0).ConnectionI nfo.ServerName = "servername"<BR><BR> CrystalReportViewer1.LogOnInfo.Item(0).ConnectionI nfo.DatabaseName = "db1"<BR> CrystalReportViewer1.LogOnInfo.Item(0).ConnectionI nfo.UserID = "user1"<BR><BR> CrystalReportViewer1.LogOnInfo.Item(0).ConnectionI nfo.Password = "mypass"<BR> <BR>End Sub<BR><BR><BR>But when I run this code.I get an exception.<BR><BR>CrystalDecisions.CrystalReports. Engine.LogOnException: Logon failed.<BR><BR>I am not able to find out the reason as all the parameters specified are correct.<BR><BR>Can any body help me out?<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Problem with crystal report

    Instead of exposing everything, assuming that your report is in the same solution as the web form that&#039;s calling it, try this code:<BR><BR>CrystalReportViewer1.ReportSource = New &#060;reportname (w/o the .rpt extension)&#062; ()<BR><BR>e.g. CrystalReportViewer.ReportSource = New CRHoursSpentByCostCenter()<BR><BR>Assuming that you&#039;ve already made the db connection in your strongly-typed report, you do not need to expose any db connection info.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts