Hi,
I am using VS 2005 and ReportViewer 2005 web control in ASP.NET 2.0 web application. I am building custom page to host reports in web application. The website is running under known NT account that has rights to the remote Reporting Server.
On the page I am using ReportService2005 web service to retrieve the list of available reports on the server and then trying to use ReportViewer control to display the selected report. I can connect to the remote Reporting Server through Web Service fine and able to retrieve all the data. I can also retrieve the report using the web service. However, when I set the URL and Report path in the ReportViewer control I get following error:
Exception: InValidOperationException
Message: Client found response content type of '', but expected 'text/xml'. The request failed with an empty response.
StackTrace: at Microsoft.SqlServer.ReportingServices2005.Execution.RSExecutionConnection.GetSecureMethods()
at Microsoft.SqlServer.ReportingServices2005.Execution.RSExecutionConnection.IsSecureMethod(String methodname)
at Microsoft.SqlServer.ReportingServices2005.Execution.RSExecutionConnection.LoadReport(String Report, String HistoryID)
at Microsoft.Reporting.WebForms.ServerReport.GetExecutionInfo()
at Microsoft.Reporting.WebForms.ServerReport.GetParameters()
at Microsoft.Reporting.WebForms.ParametersArea.GetMetaDataFromReport(Boolean useCurrentValues)
at Microsoft.Reporting.WebForms.ReportViewer.OnPreRender(EventArgs e)
Initially I thought it could be security issue, but I am able to retireve all the data and report using web service. I believe the error is in the way ReportViewer control is trying to access the report. I am using NT authentication for reporting server and ReportViewerCredentials class is a custom class that used Default Net credentials. Below is the sample code I am using:
rvMain.ProcessingMode = ProcessingMode.Remote;
rvMain.ServerReport.ReportServerCredentials = new ReportViewerCredentials();
rvMain.ServerReport.ReportServerUrl = new Uri("http://testserver/reportserver?");
rvMain.ServerReport.ReportPath = "/Test/TestReport";
I have been striggling with this for a week now. I checked all the blogs and nothing matching this. All this works fine if the reporting server is local to the web application. I would appreciate any help on this.
Ashesh S.
hi,maybe this code example can give you help.
1) implements IReportServerCredentials Interface
public class ReportServerCrendential:IReportServerCredentials
{
// access information for remote reportserver
private string _UserID;
private string _PassWord;
private string _DomainName;
public ReportServerCrendential(string UserID,string Password,string Domain)
{
_UserID = UserID;
_PassWord = Password;
_DomainName = Domain;
}
public bool GetFormsCredentials(out System.Net.Cookie cookie, out string username, out string password, out string authority)
{
cookie = null;
username = password = authority = null;
return false;
}
public WindowsIdentity ImpersonationUser
{
get
{
return null;
}
}
// use this credential
public System.Net.ICredentials NetworkCredentials
{
get
{
return new System.Net.NetworkCredential(_UserID, _PassWord, _DomainName);
}
}
}
2) use this instead of rvMain.ServerReport.ReportServerCredentials = new ReportViewerCredentials();
ReportServerCrendential myCredential = new ReportServerCrendential(UserName, password , "");
rvMain.ServerReport.ReportServerCredentials = myCredential;
.....
rvMain.ServerReport.Refresh();
|||I tried implementing the IReportServerCredentials as shown above to use username, password and domain. Still I get the same error.
Any help will be greatly appreciated, thanks!
|||Hi Ashesh,
We are experiencing a similar problem. Did you ever resolve this issue?
Thanks,
Rob
|||Rob,
No, still working on it. The Report Servers are in web farm using Enterprise Edition and the web application that connects to the report server is using the ReportViewer distrubutable from Microsoft site. I am wondering if the enterprise version has something to do with it. To confirm I am going to host the site on Report server and see if it works.
Trying all possible things. If you find anything let me know. I was hoping some Microsoft guys would answer this thread.
|||Finally I figured out the issue. Since we are using a web farm environment, we go through Virtual IP to connect to the Reporting Server. The Reporting Service web service is able resolve the VIP, but Report Viewer control is not able to handle it. If I use the report server name in the url, the report displays fine in Report Viewer.
There has to be a way to make ReportViewer contorl work in web farm environment. I believe there are some config changes that you need to do to make it work with Virtual IP. Does anybody know what settings I need to do in config file?
No comments:
Post a Comment