Groups | Blog | Home
all groups > sql server reporting services > august 2007 >

sql server reporting services : Logon failed. (rsLogonFailed)



Bruce L-C [MVP]
8/31/2007 10:06:15 AM
Two points. What role is your user in? It could be that perhaps you need to
be in a different role to get information about the report than you do to
get a list of reports? It seems to me if it worked for a list of reports
then your login must be OK.

Second issue. For something like this I recommend trying to web forum. The
other MVP is there and is familiar with webservices. Also, that is where MS
people hang out.

http://forums.microsoft.com/msdn/showforum.aspx?forumid=82&siteid=1


--
Bruce Loehle-Conger
MVP SQL Server Reporting Services

[quoted text, click to view]

Paul Cheetham
8/31/2007 3:42:31 PM
Hi,

I am writing a web application in c# that is attempting to get the
parameters from a report on a Reporting Services 2005 server.

I am using the following code:

SQLReportViewer.ServerReport.ReportServerCredentials = new
ReportCredentials(UserName, UserPassword, UserDomain);
SQLReportViewer.ServerReport.ReportPath = Rpt.FileName;
SQLReportViewer.ServerReport.ReportServerUrl = new Uri(ServerUrl);

Parameters = SQLReportViewer.ServerReport.GetParameters();

The Getparameters Line causes the following exception:


Microsoft.Reporting.WebForms.ReportServerException was unhandled by user
code
Message="Logon failed. (rsLogonFailed)"
Source="Microsoft.ReportViewer.WebForms"
ErrorCode="rsLogonFailed"
StackTrace:
at Microsoft.Reporting.WebForms.ServerReport.get_Service()
at Microsoft.Reporting.WebForms.ServerReport.GetExecutionInfo()
at Microsoft.Reporting.WebForms.ServerReport.GetParameters()


The UserName, UserPassword and UserDomain variables are all populated
with correct data, as is Rpt.FileName.
The ReportCredentials class is a very simple implementation of the
ICredentials interface - Code shown here:


-->

public class ReportCredentials : IReportServerCredentials
{
protected string _UserName, _Password, _Domain;

public ReportCredentials(string UserName, string Password, string Domain)
{
_UserName = UserName;
_Password = Password;
_Domain = Domain;
}

//*****************************************************************

public bool GetFormsCredentials (out System.Net.Cookie AuthCookie,
out string UserName, out string Password, out string Authority)
{
UserName = _UserName;
Password = _Password;
Authority = _Domain;
AuthCookie = null;
return (true);
}

//*****************************************************************

public System.Security.Principal.WindowsIdentity ImpersonationUser
{
get { return (null); }
}

//*****************************************************************

public ICredentials NetworkCredentials
{
get{ return (new NetworkCredential(_UserName, _Password, _Domain)); }
}

<--

I can use the same credentials to retrieve a list of reports from the
report server (the report I am trying to access is in that list) and to
log on directly by going to the URL of Reporting Services.

This is made more frustrating by the complete lack of detail in the
error message, as it does not say why the logon failed, or give me a
single clue about what is going on.

Has anyone seen this before and can tell me how to fix it, or is there
something stupid in my code?

Thankyou.

Paul
Paul Cheetham
8/31/2007 4:13:28 PM

OK Thanks, I'll post there.

I'm pretty sure the Role is OK, as I know the same user details are
being used successfully in another application, which I am replacing,
but that is just showing the report and is not trying to get the
Parameter list.


Paul


[quoted text, click to view]
AddThis Social Bookmark Button