Search code examples
asp.netreporting-servicesreportviewerreport-viewer2010

The attempt to connect to the report server failed - Setting URL and Path in ASP.NET?


I'm trying to connect to a Report (rdlc file) using ASP.NET Web Applications. I'm working with VS2010 and the Report Server is version 2008.

I have the following URL to the report which works fine:

http://server url/Products/_layouts/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/Products/Dashboards/Product_tool.rdl&Source=Server Url/Products/Dashboards/Forms/AllItems.aspx&DefaultItemOpen=1

When i enter that URL in my browser it first asks for a username password. When i log in then the Report shows up just fine.

Now i need to display this report in a Report Viewer. So i added a Report Viewer control to my aspx page. I configured the URls for it like so:

Report Server:** http://server url/Products/_layouts/ReportServer

Report Path:** /Products/Dashboards/Product_tool.rdl

I'm not really sure if that is even correct..?

In any case, in my PageLoad i have the following line of code:

eportViewer1.ServerReport.ReportServerCredentials = new ReportCredentials("myuser", "mypass");

The ReposrtCredentials class is taken from: http://social.msdn.microsoft.com/Forums/en-US/vsreportcontrols/thread/c65abca7-0fdb-40fb-aabe-718f63377a55/ (from Phil)

Now when i run my Web Application i get the following error:

The attempt to connect to the report server failed. Check your connection information and that the report server is a compatible version.

Now i'm not sure if the URL i supplied to the Report Viewer is right? Or what the problem else could be.

Anyone any idea..?


Solution

  • When you configure your report viewer,check whether the account you use has permission to view the report because it is necessary that you have access when using server report. Check out this link too. They will be of help : http://forums.asp.net/t/1562624.aspx/1