473,412 Members | 2,994 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,412 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 5320
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: 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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.