Dim myReport As ReportServer.PendingReport = New ReportServer.PendingReport
Dim reportProcessor As New Telerik.Reporting.Processing.ReportProcessor()
Dim result As Telerik.Reporting.Processing.RenderingResult = reportProcessor.RenderReport("PDF", myReport, Nothing)
Dim fileName As String = result.DocumentName + ".pdf"
Response.Clear()
Response.ContentType = "Application/pdf"
Response.Cache.SetCacheability(HttpCacheability.Private)
Response.Expires = -1
Response.Buffer = False
Response.AddHeader("Content-Disposition", String.Format("{0};FileName=""{1}""", "attachment", fileName))
Response.OutputStream.Write(result.DocumentBytes, 0, result.DocumentBytes.Length)
Response.End()
Firing this event causes the following error:
Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed.
Common causes for this error are when the response is modified by calls to Response.Write(), response filters,
httpModules, or server trace is enabled. Details: Error parsing near '%PDF-1.6
%
1 0 obj'
Anyone have any idea of how to avoid this other than removing Ajax Manager for the grid?