Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi

I got reporting viewer that won't display report, instead I get "Client found response content type of '', but expected 'text/xml'..." error INSIDE reporting viewer body (top menu of viewer displays normally).

I got reporting service running (SQL 2008 R2), my user can see reports and run them through localhost/reports. I did register my IReportServerConnection2 implementation class. And yes processing mode is set to remote.

Cant find solution. I also don't understand why ReportServerUrl is set twice (my implementation is similar to: http://blogs.msdn.com/b/microsoftbob/archive/2009/08/20/a-wrapper-for-running-sql-server-2008-reporting-services-reports-anonymously.aspx[^]

Check this out:
C#
[Serializable]
    public class MyReportServerConnection : IReportServerConnection2
    {
        public Uri ReportServerUrl
        {
            get
            {
                string url = "http://localhost/ReportServer/ReportService2010.asmx";
                if (string.IsNullOrEmpty(url))
                    throw new Exception("Missing url from the Web.config file");
                return new Uri(url);
            }
        }

and on page:
C#
protected void Page_Load(object sender, System.EventArgs e)
        {
        
            if (!Page.IsPostBack)
            {
                DoBind();
            }

            if (!Page.IsPostBack && Request.QueryString.Count > 0)
            {              
                string reportPath = Request.QueryString[0];
                this.ReportLabel.Text = Request.QueryString[0];
                //this.ReportViewer1.ProcessingMode = ProcessingMode.Remote;
                MyReportServerConnection rsc = new MyReportServerConnection();
                
                this.ReportViewer1.ServerReport.ReportServerCredentials = rsc;
                //pathhardcoded for test
                this.ReportViewer1.ServerReport.ReportPath = "/report1";

                this.ReportViewer1.ServerReport.ReportServerUrl =
                    new Uri(("http://localhost/ReportServer/"));       
                this.ReportViewer1.ServerReport.Refresh();
            }


Any help appreciated
Posted
Updated 24-Apr-12 4:42am
v2
Comments
S@53K^S 24-Apr-12 9:13am    
Looks like you are making a mistake in providing the report path to the report viewer.Could try appending the report1 also in the URI
mateusz.matyaszek 24-Apr-12 9:31am    
My understanding of which path should be where is poor. I tried original paths that ware same in MyReportServerConnection and in ReportViewer1.ServerReport.ReportServerUrl namely "http://localhost/ReportServer" but that doesn't work. Yes I did add localhost to Report Server Web Service URL's.

Other thing is that in the original there was:

"reportsportal.properties.settings
setting name="ReportsPortal_WsReportService_ReportingService2005" serializeas="String">
<value>http://myServer/ReportServer_myinstance/ReportService2005.asmx
/setting /reportsportal.properties.settings"
(removed "<" tags as it doesn't show)
in applicationSettings. But its not used anywhere so what is the significance of it?
mateusz.matyaszek 24-Apr-12 9:36am    
When I run original I get An error has occurred during report processing.
Cannot create a connection to data source 'DataSource1'.
Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.

1 solution

Got it fixed. In report manager I had to change properties of connection so instead of using Windows integrated security I had to use Credentials stored securely in the report server + Use as Windows credentials when connecting to the data source.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900