Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
875
export ultraWebGrid to excel produces jScript runtime error
posted

I have a grid that contains 3 bands, and a series of templated columns that contain a control.

I am having trouble exporting this grid to Excel and I can't quite figure out why.

The event handler for the Export button I have on the page does the following:

ExcelExporter.ExportMode = Infragistics.WebUI.UltraWebGrid.ExcelExport.ExportMode.Download

<sets up some general formatting and titles on the first few rows>

ExcelExporter.ExcelStartRow = 6

ExcelExporter.Export(SGViewGrid, excelWorkBook)

ExcelExporter.DownloadName = "Filename.xls"

Initially I had been also doing a Response.BinaryWrite and Response.End but due to the errors I had been encountering I have commented out everything after the ExcelExporter.DownloadName to assist in troubleshooting.  The error I am recieving is the following:

Microsoft JScript runtime 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 'ࡱ'.

I am assuming that I'm getting this error due to the controls in the  templated columns, but I need to be able to export this grid to excel - does anyone know what I need to do to fix this?

 Thanks!!

Parents
No Data
Reply
  • 28464
    posted

    Hello,

    It is very hard to debug the issue in public forums, however I do have several suggestions that might help:

    1) For templated columns and file exports - This may be logical to some point, since templates can contain anything including complex server-side controls, so maybe the exported cannot be that clever to export that.

    I have a suggestion though - for exporting data, you can create a new datasource with one extra column / field that you can construct with code and could be what the templated column showed (or a simplified text version of it, if it contains server controls)

    2) Another suggestion - can you move setting the DownLoadName property before doing the actual Export

    3) Are you using any sort of AJAX enablers like WebAsyncRefreshPanel and/or UpdatePanel? File exports are not compatible with these.

    4) Do you have any HttpHandlers / Modules in your website, like URL Redirects, ZIP Compressions modules, etc - these may interfere with the download in some way.

    5) Can you use an HTTP monitoring tool like Fiddler or FireBug for FireFox to see what the actual output from the server is - this may provide additional clues.

     

Children