locked
Report Viewer Control Server Side Report RRS feed

  • Question

  • User-924837209 posted

    The 'rptViewer.ServerReport.SetParameters(parameters);' line of code is returning the below error message.  I seem to have access to the report by using the report server URL and report path.  What is causing this error message?  This is a server side report.  Thanks!

    Client found response content type of '', but expected 'text/xml'. The request failed with an empty response.

    Complete Code:

    MyReportServerCredentials c = new MyReportServerCredentials("username", "pwd", "domain");

    ReportParameter[] parameters = new ReportParameter[1];

    parameters[0] = new ReportParameter("ApplicationID", "3");

    rptViewer.ServerReport.ReportServerCredentials = c;

    rptViewer.ServerReport.ReportServerUrl = new Uri("http://sqldev/reportserver/SaleReview");

    rptViewer.ServerReport.ReportPath = "/Application.rdlc";

    rptViewer.ServerReport.SetParameters(parameters);

    rptViewer.ProcessingMode = ProcessingMode.Remote;

    rptViewer.Visible = true;

    rptViewer.ServerReport.Refresh();

    Monday, June 9, 2014 8:24 PM

Answers

  • User1140095199 posted

    Hi,

    lakeshore

    Client found response content type of '', but expected 'text/xml'. The request failed with an empty response.

    The above URL simply means that the specified URL does not return any service.

    In most cases it is simply incorrect. So, make sure that the URL is correct.

    Try to paste the URL in the browser and make sure you can access the server.

    Refer to the following POST:

    http://social.msdn.microsoft.com/Forums/en-US/3bf287ec-051f-4d18-9cc7-c65065f50e2c/client-found-response-content-type-of-texthtml-but-expected-textxml?forum=sqlreportingservices

    http://stackoverflow.com/questions/3865825/report-viewer-error-message-client-found-response-content-type-of-but-expect

    Also, I feel the ReportServerUrl and Report path are not specified correctly in your code:

    lakeshore

    rptViewer.ServerReport.ReportServerUrl = new Uri("http://sqldev/reportserver/SaleReview");

    rptViewer.ServerReport.ReportPath = "/Application.rdlc";

    Refer to the following article:

    http://msdn.microsoft.com/en-us/library/aa337091.aspx

    Code:

    protected void Page_Init(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            // Set the processing mode for the ReportViewer to Remote
            reportViewer.ProcessingMode = ProcessingMode.Remote;
    
            ServerReport serverReport = reportViewer.ServerReport;
    
            // Set the report server URL and report path
            serverReport.ReportServerUrl =
                new Uri("http://<Server Name>/reportserver");
            serverReport.ReportPath =
                "/AdventureWorks Sample Reports/Sales Order Detail";
    
            // Create the sales order number report parameter
            ReportParameter salesOrderNumber = new ReportParameter();
            salesOrderNumber.Name = "SalesOrderNumber";
            salesOrderNumber.Values.Add("SO43661");
    
            // Set the report parameters for the report
            reportViewer.ServerReport.SetParameters(
                new ReportParameter[] { salesOrderNumber });
        }
    }
    

    rswebserviceurl                                   

    The Web service URL of the report server. For native mode, it is the Web service URL of the report server instance configured in Reporting Services Configuration Manager (see Configure Report Server URLs  (SSRS Configuration Manager)). For example:

    http://myrshost/reportserver 
    https://machine.adventure-works.com/reportserver_MYNAMEDINSTANCE

    For SharePoint integrated mode, it is the URL of the Reporting Services proxy at a SharePoint site integrated with Reporting Services. For example:

    http://myspsite/subsite/_vti_bin/reportserver

    pathinfo                                   

    The relative path name of the item in the native mode report server database, or the fully qualified URL of the item in a SharePoint catalog.

    The path of the catalog item. For native mode, it is the relative path of the item in the report server database, beginning with a slash (/). For example:

    /AdventureWorks 2008R2/Employee_Sales_Summary_2008R2

    For SharePoint integrated mode, it is the fully qualified URL of the item in the SharePoint library, including the item extension. For example:

    http://myspsite/subsite/AdventureWorks 2008R2/Employee_Sales_Summary_2008R2.rdl 

    &                                                        

    Used to separate name and value pairs of URL access parameters.

    prefix                                   

    Optional. A prefix for the URL access parameter (for example, rs: or rc:) that accesses a specific process running within the report server.

    Note                           Note                        

    If a prefix for a URL access parameter is not included, the parameter is processed by the report server as a report parameter. Report parameters do not use a parameter prefix and are case-sensitive.

    param                                   

    The parameter name.

    value                                    

    URL text corresponding to the value of the parameter being used.

    Note: For a list of the available URL access parameters, see URL Access Parameter Reference. For examples passing report parameters on the URL, see Pass a Report Parameter Within a URL.

    For more reference:

    URL Access (SSRS)

    Make sure URL and Path are specified correctly.

    Best Regards!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, June 11, 2014 3:16 AM