473,387 Members | 1,621 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 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 15010
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.