This is a migrated thread and some comments may be shown as answers.

[Solved] CommandItemTemplate with Ajaxified Grid

1 Answer 119 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 16 Sep 2009, 02:09 PM
I have an Ajaxified grid wired up to the AjaxLoadingPanel.  I am using a command item template in which I have a "Print" option link button.  The link calls a client-side script to run a report.  The server side event for this link does the following:

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? 

 

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 17 Sep 2009, 07:22 AM
Hello Robert,

Can you try disabling Ajax for your grid on clicking the linkbutton in the commandItemTemplate and see if it helps clear the error. Here's a help document which you can refer to export data from an ajaxified grid:
Export from ajaxified grid

Hope this helps to some extent...
Princy.
Tags
Grid
Asked by
Robert
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or