rohitnet100
asked on
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
'RenderPDF()
Dim rview As New Microsoft.Reporting.WebFor ms.ReportV iewer()
Dim apr As New AppSettingsReader()
rview.ServerReport.ReportS erverUrl = New Uri(apr.GetValue("ReportSe rver", GetType(String)))
Dim paramList As New System.Collections.Generic .List(Of Microsoft.Reporting.WebFor ms.ReportP arameter)( )
paramList.Add(New Microsoft.Reporting.WebFor ms.ReportP arameter(" @DateServe d", RadDatePick.SelectedDate))
paramList.Add(New Microsoft.Reporting.WebFor ms.ReportP arameter(" @Location" , ddlSch.SelectedValue))
paramList.Add(New Microsoft.Reporting.WebFor ms.ReportP arameter(" @MenuType" , ddlmenutype.SelectedValue) )
rview.ServerReport.ReportP ath = "/ReportFolder/ReportName"
rview.ServerReport.SetPara meters(par amList)
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.WebFor ms.Warning () = Nothing
Dim format As String = "PDF"
deviceInfo = "<DeviceInfo>" + "<SimplePageHeaders>True</ SimplePage Headers>" + "</DeviceInfo>"
Dim bytes As Byte() = rview.ServerReport.Render( format, deviceInfo, mimeType, encoding, extension, streamIds, warnings)
Response.Clear()
If format = "PDF" Then
Response.ContentType = "application/pdf"
Response.AddHeader("Conten t-disposit ion", "filename=output.pdf")
End If
Response.OutputStream.Writ e(bytes, 0, bytes.Length)
Response.OutputStream.Flus h()
Response.OutputStream.Clos e()
Response.Flush()
Response.Close()
End Sub
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
'RenderPDF()
Dim rview As New Microsoft.Reporting.WebFor
Dim apr As New AppSettingsReader()
rview.ServerReport.ReportS
Dim paramList As New System.Collections.Generic
paramList.Add(New Microsoft.Reporting.WebFor
paramList.Add(New Microsoft.Reporting.WebFor
paramList.Add(New Microsoft.Reporting.WebFor
rview.ServerReport.ReportP
rview.ServerReport.SetPara
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.WebFor
Dim format As String = "PDF"
deviceInfo = "<DeviceInfo>" + "<SimplePageHeaders>True</
Dim bytes As Byte() = rview.ServerReport.Render(
Response.Clear()
If format = "PDF" Then
Response.ContentType = "application/pdf"
Response.AddHeader("Conten
End If
Response.OutputStream.Writ
Response.OutputStream.Flus
Response.OutputStream.Clos
Response.Flush()
Response.Close()
End Sub
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Thanks.
ASKER
I made these changes still, i got same error.