473,322 Members | 1,352 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,322 software developers and data experts.

Getting logon error in Crystal Reports in ASP.Net

I'm not sure why this is happening. I'm trying to run a late-bound report.
My original code looked like this:

TableLogOnInfo logOnInfo = new TableLogOnInfo ();
logOnInfo.ConnectionInfo.ServerName = "<server name>";
logOnInfo.ConnectionInfo.DatabaseName = "<dbname>";
logOnInfo.ConnectionInfo.UserID = "<user id>";
logOnInfo.ConnectionInfo.Password = "<password>";
logOnInfo.TableName = "Student";

CrystalReportViewer1.ReportSource = Server.MapPath(".") +
"\\StudentContactRoster.rpt";
CrystalReportViewer1.LogOnInfo.Add(logOnInfo);

I run it and get a logon error. I've checked everything, the server name,
database name, user ID, password, tablename, etc., and they all check out. I
use much the same parameters in the data adapters I use elsewhere in the
application, and they work.

I tried a different solution, suggested by a post-er on this newsgroup, and
came up with this:

TableLogOnInfo li = null;
CrystalDecisions.CrystalReports.Engine.ReportDocum ent rp =
new CrystalDecisions.CrystalReports.Engine.ReportDocum ent();
rp.Load(Server.MapPath(".") + "\\StudentContactRoster.rpt");
for (int i = 0; i < rp.Database.Tables.Count; i++)
{
li = rp.Database.Tables[i].LogOnInfo;
TableLogOnInfo logOnInfo = new TableLogOnInfo();
li.ConnectionInfo.ServerName = "<server name>";
li.ConnectionInfo.DatabaseName = "<dbname>";
li.ConnectionInfo.UserID = "<user id>";
li.ConnectionInfo.Password = "<password>";
rp.Database.Tables[i].ApplyLogOnInfo(li);
}

StudentContactRosterReportViewer.ReportSource = rp;

I run this, using the same parameters as the first code block, and also get
a logon error. Anyone got some clues about what's going on here?

Thanks.

Jul 21 '05 #1
2 5318
I should also mention that I'm using SQL Server 2000 as the database for this
report, and that I'm using VS.Net 2003. Unfortunately I don't know which
version of Crystal Reports was used to create the report, since it was
created by another contractor. Is that important to solving the problem? I
do know that the report designer used SQL Server 2000 as his database as
well. So I don't think it's a driver issue.

"Mark Miller" wrote:
I'm not sure why this is happening. I'm trying to run a late-bound report.
My original code looked like this:

TableLogOnInfo logOnInfo = new TableLogOnInfo ();
logOnInfo.ConnectionInfo.ServerName = "<server name>";
logOnInfo.ConnectionInfo.DatabaseName = "<dbname>";
logOnInfo.ConnectionInfo.UserID = "<user id>";
logOnInfo.ConnectionInfo.Password = "<password>";
logOnInfo.TableName = "Student";

CrystalReportViewer1.ReportSource = Server.MapPath(".") +
"\\StudentContactRoster.rpt";
CrystalReportViewer1.LogOnInfo.Add(logOnInfo);

I run it and get a logon error. I've checked everything, the server name,
database name, user ID, password, tablename, etc., and they all check out. I
use much the same parameters in the data adapters I use elsewhere in the
application, and they work.

I tried a different solution, suggested by a post-er on this newsgroup, and
came up with this:

TableLogOnInfo li = null;
CrystalDecisions.CrystalReports.Engine.ReportDocum ent rp =
new CrystalDecisions.CrystalReports.Engine.ReportDocum ent();
rp.Load(Server.MapPath(".") + "\\StudentContactRoster.rpt");
for (int i = 0; i < rp.Database.Tables.Count; i++)
{
li = rp.Database.Tables[i].LogOnInfo;
TableLogOnInfo logOnInfo = new TableLogOnInfo();
li.ConnectionInfo.ServerName = "<server name>";
li.ConnectionInfo.DatabaseName = "<dbname>";
li.ConnectionInfo.UserID = "<user id>";
li.ConnectionInfo.Password = "<password>";
rp.Database.Tables[i].ApplyLogOnInfo(li);
}

StudentContactRosterReportViewer.ReportSource = rp;

I run this, using the same parameters as the first code block, and also get
a logon error. Anyone got some clues about what's going on here?

Thanks.

Jul 21 '05 #2
I finally figured out how to fix my problem with this, and thought I'd share
it since many other people have run into similar problems.

Microsoft has an article on this issue at:

http://support.microsoft.com/default...b;en-us;319264

This is Microsoft's answer to the problem. They basically say you need to
set up your LogOnInfo and ConnectionInfo inside your ASP.Net code, and then
go through each table in the report's document and set the LogOnInfo and
ConnectionInfo for each individually. This is "by design" for security
reasons. I put in the code they said to use for this issue, but it didn't
totally solve the problem.

What I ultimately had to do was go bring up the .rpt file in VS.Net,
right-click in the report, and go to Database|Verify Database... This
brought up a wizard which allowed me to view/enter connection parameters such
as database name, login settings, and the database name. The wizard allowed
me to try connecting using the existing parameters and it didn't work. The
report itself was set to the wrong server name, and was set to use Integrated
Windows Authentication. I thought by assigning my own datasource
information, connection information, etc. that it would override what was
programmed into the report. It turns out it doesn't.

I used the wizard to set the report's server name to the correct name, and
turned off Windows Authentication, and put in the correct user ID and
password information. This changed the connection and logon information for
the report itself, the .rpt file. I was able to test these parameters in the
wizard, and they worked. Only then, when I ran my ASP.Net app. did the
report finally work.

Jul 21 '05 #3

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

Similar topics

0
by: Mukesh Kumar | last post by:
hi all, I have created some independent reports through crystal reports developer edition v 10 and developed a small tool in .net framework v 1.1 to view these reports through the crystal reports...
2
by: Jonathan | last post by:
Hi all, It's my first post here, so be kind :) I got a little application that keep track of a small inventory, everything was going great until came the time to make some types of reports. I...
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...
3
by: Milan Todorovic | last post by:
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...
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...
0
by: Ben | last post by:
Hi We have been developing an intranet using VB .NET displaying crystal reports. We repeatedly receive the error below on both the development machine and the deployment server: I have...
2
by: Mark Miller | last post by:
I'm not sure why this is happening. I'm trying to run a late-bound report. My original code looked like this: TableLogOnInfo logOnInfo = new TableLogOnInfo ();...
1
by: abc | last post by:
Our web project is used VS2003 and Crystal Reports for Visual Studio.NET. There have reports that directly call to sql server's stored procedure. I also call SetDatabaseLogon method to change user...
1
by: swatii | last post by:
Hi, I am new to .NET.I have created a desktop application in C#.NET that has Crystal reports used in it. This all works fine when I log in on the "EVERY" as servername which is the default name...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.