473,666 Members | 2,047 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Conne ctionInfo.Serve rName = "<server name>";
logOnInfo.Conne ctionInfo.Datab aseName = "<dbname>";
logOnInfo.Conne ctionInfo.UserI D = "<user id>";
logOnInfo.Conne ctionInfo.Passw ord = "<password> ";
logOnInfo.Table Name = "Student";

CrystalReportVi ewer1.ReportSou rce = Server.MapPath( ".") +
"\\StudentConta ctRoster.rpt";
CrystalReportVi ewer1.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;
CrystalDecision s.CrystalReport s.Engine.Report Document rp =
new CrystalDecision s.CrystalReport s.Engine.Report Document();
rp.Load(Server. MapPath(".") + "\\StudentConta ctRoster.rpt");
for (int i = 0; i < rp.Database.Tab les.Count; i++)
{
li = rp.Database.Tab les[i].LogOnInfo;
TableLogOnInfo logOnInfo = new TableLogOnInfo( );
li.ConnectionIn fo.ServerName = "<server name>";
li.ConnectionIn fo.DatabaseName = "<dbname>";
li.ConnectionIn fo.UserID = "<user id>";
li.ConnectionIn fo.Password = "<password> ";
rp.Database.Tab les[i].ApplyLogOnInfo (li);
}

StudentContactR osterReportView er.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 5340
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.Conne ctionInfo.Serve rName = "<server name>";
logOnInfo.Conne ctionInfo.Datab aseName = "<dbname>";
logOnInfo.Conne ctionInfo.UserI D = "<user id>";
logOnInfo.Conne ctionInfo.Passw ord = "<password> ";
logOnInfo.Table Name = "Student";

CrystalReportVi ewer1.ReportSou rce = Server.MapPath( ".") +
"\\StudentConta ctRoster.rpt";
CrystalReportVi ewer1.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;
CrystalDecision s.CrystalReport s.Engine.Report Document rp =
new CrystalDecision s.CrystalReport s.Engine.Report Document();
rp.Load(Server. MapPath(".") + "\\StudentConta ctRoster.rpt");
for (int i = 0; i < rp.Database.Tab les.Count; i++)
{
li = rp.Database.Tab les[i].LogOnInfo;
TableLogOnInfo logOnInfo = new TableLogOnInfo( );
li.ConnectionIn fo.ServerName = "<server name>";
li.ConnectionIn fo.DatabaseName = "<dbname>";
li.ConnectionIn fo.UserID = "<user id>";
li.ConnectionIn fo.Password = "<password> ";
rp.Database.Tab les[i].ApplyLogOnInfo (li);
}

StudentContactR osterReportView er.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
1406
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 viewer provided by .net. This is a stand-alone windows application and nothing to do with the server. I am using local SQL anywhere database and connection is via an ODBC DSN. Before launching the reports I am passing the login information to...
2
2333
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 want to use Crystal Reports in the background to generate the reports for me, i don't want any preview, any popup (only a print dialog then send it to the selected printer). That should be pretty easy ;) First of all, my app doesnt make any use of...
2
2544
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 reports give me the login error. Any ideas?
3
15030
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 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.LogOnException: Logon failed) The internet search shows that this is a common problem,...
9
6872
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 via VS 2003). The data source to the report is a stored procedure (SQL S2K) that has no parameters. I'm also using SQL Server authentication to log in. I added the report to my project (as was suggested recently by someone in a different...
0
1026
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 read the information on many sites and followed instructions with no luck, any help would be much appreciated.
2
397
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 (); logOnInfo.ConnectionInfo.ServerName = "<server name>"; logOnInfo.ConnectionInfo.DatabaseName = "<dbname>"; logOnInfo.ConnectionInfo.UserID = "<user id>"; logOnInfo.ConnectionInfo.Password = "<password>"; logOnInfo.TableName = "Student";
1
1980
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 id and password. But I found the crystal reports use ASPNET account to logon SQL Server, not my expected user id. Our SQL Server is MSDE and run on mixed authenitcation mode.
1
5261
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 of my machine and also SQL SERVER name. However when I run it on another machine it does not work.It expect "EVERY" server.It should expect because the name of the sql server is that. If I specify the servername as local while generating report then...
0
8783
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8552
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7387
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6198
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5666
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4198
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4369
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1776
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.