Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal .net logon failed 1

Status
Not open for further replies.

FlashGorden

IS-IT--Management
Nov 8, 2001
22
0
0
EU
Hi All
I am trying to use the Crystal Web Viewer in .NET, but I get the following error:Exception Details: CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed.

My code is as follows:
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Public Class cry_test
Inherits System.Web.UI.Page
Protected WithEvents CrystalReportViewer1 As CrystalDecisions.Web.CrystalReportViewer
Dim cr As CrystalReport1 = New CrystalReport1()
Dim crTable As TableLogOnInfo = New TableLogOnInfo()
Dim crconn As ConnectionInfo = New ConnectionInfo()
Dim crdb As CrystalDecisions.CrystalReports.Engine.Database
Dim crtbls As CrystalDecisions.CrystalReports.Engine.Tables
Dim crtbl As CrystalDecisions.CrystalReports.Engine.Table
Dim sever As HttpServerUtility
#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

End Sub

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
Me.CrystalReportViewer1.DataBind()
End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Not Page.IsPostBack Then
CrystalReportViewer1.ReportSource = Server.MapPath(&quot;\test_hr_db\CrystalReport1.rpt&quot;)
'CrystalReportViewer1.ReportSource = &quot; CrystalReportViewer1.LogOnInfo.Item(0).ConnectionInfo.ServerName = &quot;my server&quot;
CrystalReportViewer1.LogOnInfo.Item(0).ConnectionInfo.UserID = &quot;user name&quot;
CrystalReportViewer1.LogOnInfo.Item(0).ConnectionInfo.Password = &quot;pwd&quot;
CrystalReportViewer1.LogOnInfo.Item(0).ConnectionInfo.DatabaseName = &quot;database name&quot;
End If

End Sub

End Class

Any help woul be appreicated.
Thanks
 
What kind of DBMS is it? I would think about using a DataSet as your report source, and having the log on at the Ole or SQL connection.
 
Did you ever solve this? I'm having the same problem and trying to find a fix.

Bob
 
No. And I've tried using a DataSet and still get the same message.
 
Ok. I'm sure you've solved this problem by now(noticing the date), but I'm posting this for others that may have the same problem!

I got the same error message, but I was trying to use connections that I had set up through Crystal Reports natively (outside .NET).

I found that if I created a new connection(within .NET now) by:

1) Right click on the &quot;Details Section&quot; of the report, and select &quot;Database&quot; -> &quot;Add/Remove Database&quot;

2) In the &quot;Database Expert&quot; pop up window, expand the &quot;OLE DB (ADO)&quot; option which should bring up another &quot;OLE DB (ADO)&quot; pop up

3) In the &quot;OLE DB (ADO)&quot; pop up, Select &quot;Microsoft OLE DB Provider for SQL Server&quot; or whatever is applicable (I also use ODBC connections to get to the host) and click &quot;Next&quot;..

I'm not really sure why my other connections didn't work, but I spent 2 days (ok, maybe not total days) surfing the web for solutions, and this is the only one that worked for me.

Good luck everyone, hope this helps,
Ruth Lamy

 
Did you remove the connection info from the .NET code or did you leave it in there? I did what you said and I am still having the same error.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top