Client found response content type of '', but expected 'text/xml'.

I goet this error when trying to execute my SSRS reports.
Client found response content type of '', but expected 'text/xml'.
The request failed with an empty response.
VB Code:
Private Sub btnprint_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnprint.Click

        Dim rview As New Microsoft.Reporting.WebForms.ReportViewer()
        Dim apr As New AppSettingsReader()
        rview.ServerReport.ReportServerUrl = New Uri(apr.GetValue("ReportServer", GetType(String)))
        Dim paramList As New System.Collections.Generic.List(Of Microsoft.Reporting.WebForms.ReportParameter)()
        paramList.Add(New Microsoft.Reporting.WebForms.ReportParameter("@DateServed", RadDatePick.SelectedDate))
        paramList.Add(New Microsoft.Reporting.WebForms.ReportParameter("@Location", ddlSch.SelectedValue))
        paramList.Add(New Microsoft.Reporting.WebForms.ReportParameter("@MenuType", ddlmenutype.SelectedValue))

        rview.ServerReport.ReportPath = "/ReportFolder/ReportName"

        Dim mimeType As String = Nothing
        Dim encoding As String = Nothing
        Dim extension As String = Nothing
        Dim deviceInfo As String = Nothing
        Dim streamIds As String() = Nothing
        Dim warnings As Microsoft.Reporting.WebForms.Warning() = Nothing
        Dim format As String = "PDF"

        deviceInfo = "<DeviceInfo>" + "<SimplePageHeaders>True</SimplePageHeaders>" + "</DeviceInfo>"
        Dim bytes As Byte() = rview.ServerReport.Render(format, deviceInfo, mimeType, encoding, extension, streamIds, warnings)

        If format = "PDF" Then
            Response.ContentType = "application/pdf"
            Response.AddHeader("Content-disposition", "filename=output.pdf")
        End If

        Response.OutputStream.Write(bytes, 0, bytes.Length)
    End Sub
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Carl TawnSystems and Integration DeveloperCommented:
Try changing:
        If format = "PDF" Then
            Response.ContentType = "application/pdf"
            Response.AddHeader("Content-disposition", "filename=output.pdf")
        End If

Open in new window

        If format = "PDF" Then
            Response.ContentType = "application/pdf"
            Response.AddHeader("Content-disposition", "filename=output.pdf")
            Response.ContentType = "text/xml"
        End If

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rohitnet100Author Commented:
Hi carl,

I made these changes still, i got same error.
rohitnet100Author Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.