472,779 Members | 1,824 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,779 software developers and data experts.

Crystal Reports 'Logon failed' problem

Hello,

I need help. I have experience in ASP.NET programming, but this is my first
dealing with Crystal Reports. I'm trying to make the most basic report
purely for testing purposes: connect to the remote SQL DB and create a
report on one of the tables. Every time I do it, I get the Logon Failed
error (CrystalDecisions.CrystalReports.Engine.LogOnExcep tion: Logon failed)

The internet search shows that this is a common problem, especially for
those using the 'pull' method. In my case it occurs in both 'push' and
'pull' methods. The problem I guess lies in the lack of credentials to
connect to the data source (DB in this case). Most solutions mentions the
SetDatabaseLogon method, but that method does not belong to the
ReportDocument object even though the documentation shows that it should.
Even with all those solutions, I still haven't managed to solve my problem!
I have a feeling I'm missing something really obvious.

To explain what exactly I'm doing. In a project, I created the
CrystalReport1.rpt file, that connects to the SQL DB by specifying the
server, username and password (not using integrated security). In the
webform I created a CrystalReportViewer instance crv. In the code behind I
put the following code:

Dim rpt As New CrystalDecisions.CrystalReports.Engine.ReportDocum ent()
rpt.Load("C:\\Inetpub\\wwwroot\\TestCrystal\\Cryst alReport1.rpt")
crv.ReportSource = rpt
crv.DataBind()

What exactly do I need to do here to get this report to show? Any input is
greatly appreciated.

Thanks

Milan
Nov 19 '05 #1
3 14949
Hi,

Try this:
http://www.dotnetjunkies.com/Tutoria...40CA588D33D3.d
cik

HTH,
Mike

"Milan Todorovic" <mi*************@ttu.edu> wrote in message
news:Oj**************@tk2msftngp13.phx.gbl...
Hello,

I need help. I have experience in ASP.NET programming, but this is my first dealing with Crystal Reports. I'm trying to make the most basic report
purely for testing purposes: connect to the remote SQL DB and create a
report on one of the tables. Every time I do it, I get the Logon Failed
error (CrystalDecisions.CrystalReports.Engine.LogOnExcep tion: Logon failed)
The internet search shows that this is a common problem, especially for
those using the 'pull' method. In my case it occurs in both 'push' and
'pull' methods. The problem I guess lies in the lack of credentials to
connect to the data source (DB in this case). Most solutions mentions the
SetDatabaseLogon method, but that method does not belong to the
ReportDocument object even though the documentation shows that it should.
Even with all those solutions, I still haven't managed to solve my problem! I have a feeling I'm missing something really obvious.

To explain what exactly I'm doing. In a project, I created the
CrystalReport1.rpt file, that connects to the SQL DB by specifying the
server, username and password (not using integrated security). In the
webform I created a CrystalReportViewer instance crv. In the code behind I
put the following code:

Dim rpt As New CrystalDecisions.CrystalReports.Engine.ReportDocum ent()
rpt.Load("C:\\Inetpub\\wwwroot\\TestCrystal\\Cryst alReport1.rpt")
crv.ReportSource = rpt
crv.DataBind()

What exactly do I need to do here to get this report to show? Any input is
greatly appreciated.

Thanks

Milan

Nov 19 '05 #2
I don't know if this will help or not, but it's worth a try. Depending on
the way you have the connection from your Crystal Report to your SQL Server,
you'll have to "log in" the Crystal Report. In other words, your Crystal
Report has to connect to the SQL Server someway. I added some code. Hope
it helps.

Dim tblCurrent As CrystalDecisions.CrystalReports.Engine.Table
Dim tliCurrent As CrystalDecisions.Shared.TableLogOnInfo
Dim strSel As String
Dim ClassID As Integer = 1
Try
'get report file and location from web.config
oRpt.Load(CS.AppSettings("RptLocation") & CS.AppSettings("RptFileName"))
Catch lex As LoadSaveReportException
lblError.Text = "Error loading the report" & vbCrLf & lex.Message
Catch ex As Exception
lblError.Text = "General Error" & vbCrLf & ex.Message
End Try
Try
'log the Crystal Report in
For Each tblCurrent In oRpt.Database.Tables
tliCurrent = tblCurrent.LogOnInfo
With tliCurrent.ConnectionInfo
'get log in info from web.config
.ServerName = CS.AppSettings("SQLServer")
.DatabaseName = CS.AppSettings("Database")
.UserID = CS.AppSettings("UserId")
.Password = CS.AppSettings("Password")
End With
'apply the log in info
tblCurrent.ApplyLogOnInfo(tliCurrent)
Next tblCurrent
Catch ex As Exception
lblError.Visible = True
lblError.Text = "Report Logon Error" & vbCrLf & ex.Message
End Try
Try
crv1.ReportSource = oRpt
Catch ex As Exception
lblError.Text = "Selection Error" & vbCrLf & ex.Message
End Try
End Sub

"Milan Todorovic" <mi*************@ttu.edu> wrote in message
news:Oj**************@tk2msftngp13.phx.gbl...
Hello,

I need help. I have experience in ASP.NET programming, but this is my first dealing with Crystal Reports. I'm trying to make the most basic report
purely for testing purposes: connect to the remote SQL DB and create a
report on one of the tables. Every time I do it, I get the Logon Failed
error (CrystalDecisions.CrystalReports.Engine.LogOnExcep tion: Logon failed)
The internet search shows that this is a common problem, especially for
those using the 'pull' method. In my case it occurs in both 'push' and
'pull' methods. The problem I guess lies in the lack of credentials to
connect to the data source (DB in this case). Most solutions mentions the
SetDatabaseLogon method, but that method does not belong to the
ReportDocument object even though the documentation shows that it should.
Even with all those solutions, I still haven't managed to solve my problem! I have a feeling I'm missing something really obvious.

To explain what exactly I'm doing. In a project, I created the
CrystalReport1.rpt file, that connects to the SQL DB by specifying the
server, username and password (not using integrated security). In the
webform I created a CrystalReportViewer instance crv. In the code behind I
put the following code:

Dim rpt As New CrystalDecisions.CrystalReports.Engine.ReportDocum ent()
rpt.Load("C:\\Inetpub\\wwwroot\\TestCrystal\\Cryst alReport1.rpt")
crv.ReportSource = rpt
crv.DataBind()

What exactly do I need to do here to get this report to show? Any input is
greatly appreciated.

Thanks

Milan

Nov 19 '05 #3
chuck, thanx for the code snipplet. I can't believe that C Reports is just as
messy since four years ago when i started to use them (deployng them via a
windows app).

The only thing with your code is that I can't figure out how to populate the
report with my dataset?

I've tried,
testr.SetDataSource(dstABC)
testr.Load(Server.MapPath("reportname1.rpt"))

but I get an error:
[LoadSaveReportException: Invalid report file path.]

Help???? This shouldn't have to be this hard. Thanx. (VB.NET)
"chuckdfoster" wrote:
I don't know if this will help or not, but it's worth a try. Depending on
the way you have the connection from your Crystal Report to your SQL Server,
you'll have to "log in" the Crystal Report. In other words, your Crystal
Report has to connect to the SQL Server someway. I added some code. Hope
it helps.

Dim tblCurrent As CrystalDecisions.CrystalReports.Engine.Table
Dim tliCurrent As CrystalDecisions.Shared.TableLogOnInfo
Dim strSel As String
Dim ClassID As Integer = 1
Try
'get report file and location from web.config
oRpt.Load(CS.AppSettings("RptLocation") & CS.AppSettings("RptFileName"))
Catch lex As LoadSaveReportException
lblError.Text = "Error loading the report" & vbCrLf & lex.Message
Catch ex As Exception
lblError.Text = "General Error" & vbCrLf & ex.Message
End Try
Try
'log the Crystal Report in
For Each tblCurrent In oRpt.Database.Tables
tliCurrent = tblCurrent.LogOnInfo
With tliCurrent.ConnectionInfo
'get log in info from web.config
.ServerName = CS.AppSettings("SQLServer")
.DatabaseName = CS.AppSettings("Database")
.UserID = CS.AppSettings("UserId")
.Password = CS.AppSettings("Password")
End With
'apply the log in info
tblCurrent.ApplyLogOnInfo(tliCurrent)
Next tblCurrent
Catch ex As Exception
lblError.Visible = True
lblError.Text = "Report Logon Error" & vbCrLf & ex.Message
End Try
Try
crv1.ReportSource = oRpt
Catch ex As Exception
lblError.Text = "Selection Error" & vbCrLf & ex.Message
End Try
End Sub

"Milan Todorovic" <mi*************@ttu.edu> wrote in message
news:Oj**************@tk2msftngp13.phx.gbl...
Hello,

I need help. I have experience in ASP.NET programming, but this is my

first
dealing with Crystal Reports. I'm trying to make the most basic report
purely for testing purposes: connect to the remote SQL DB and create a
report on one of the tables. Every time I do it, I get the Logon Failed
error (CrystalDecisions.CrystalReports.Engine.LogOnExcep tion: Logon

failed)

The internet search shows that this is a common problem, especially for
those using the 'pull' method. In my case it occurs in both 'push' and
'pull' methods. The problem I guess lies in the lack of credentials to
connect to the data source (DB in this case). Most solutions mentions the
SetDatabaseLogon method, but that method does not belong to the
ReportDocument object even though the documentation shows that it should.
Even with all those solutions, I still haven't managed to solve my

problem!
I have a feeling I'm missing something really obvious.

To explain what exactly I'm doing. In a project, I created the
CrystalReport1.rpt file, that connects to the SQL DB by specifying the
server, username and password (not using integrated security). In the
webform I created a CrystalReportViewer instance crv. In the code behind I
put the following code:

Dim rpt As New CrystalDecisions.CrystalReports.Engine.ReportDocum ent()
rpt.Load("C:\\Inetpub\\wwwroot\\TestCrystal\\Cryst alReport1.rpt")
crv.ReportSource = rpt
crv.DataBind()

What exactly do I need to do here to get this report to show? Any input is
greatly appreciated.

Thanks

Milan


Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Max | last post by:
Hi wise people, Has anyone encountered the Crystal Reports problem I describe below? If so, how did you solve it? It seems that every article posted on google regarding CR and logon problems is...
0
by: Bonj | last post by:
Hi I am trying to create a simple 'hello world' type web application involving a crystal report. I have basically done it the simplest possible way as described in the documentation, by adding a...
0
by: stephan | last post by:
I know that this has been beaten to death but I can't seem to resolve my issues (I have 2 of them). I have created a class that exposes a public method which returns a datatable as a datasource...
2
by: Karun Karunakaran | last post by:
Hi, I am using the Crystal Enterprise .NET assemblies to generate and display a crystal report in a webform. This report connects to an SQL server (running locally) using a specific username and...
2
by: GFro | last post by:
I am getting the following error since we upgraded from .NET Framework 1.0 to 1.1. The reports all ran fine yesterday. I get this error in all apps with reports. The apps run fine but the...
1
by: andy lim | last post by:
Hello all, I'm developing a web application using ASP.NET/VB. I have problem in viewing my CR reports. It returns following exception when I tried to view any CR report. ...
9
by: mollyf | last post by:
I have tried various suggestions that I have found searching the newsgroups and still haven't been able to figure why I keep getting the logon failed error. I created a report in Crystal (not...
3
by: Shawn H. Mesiatowsky | last post by:
I have come across lots of information regarding this, but nothing seems to work. I have created a Crystal Report that access's a SQL server backend for the data, and I want to display the report...
19
by: Michael O'Donnell | last post by:
Hi All Am having major problem with crystal reports...Have designed my report no problem, its when I try to run and display ther report that I am getting a "Login Failed" message. At first I...
0
by: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.