export to excel

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mike

    #1

    export to excel

    On my page I'm using an updatepanel, updateProgress, and a ModalProgress,
    everything works great But when I try to export my GridView to excel I'm
    getting the following error message:

    Sys.WebForms.Pa geRequestManage rParserErrorExc eption: The message received
    from the server could not be parsed. Common cause for this error are when
    the response is modified by calls to Response.Write( ), response filters,
    HttpModules, or server trace is enable.

    Details: Error parsing near '<div>
    <table cells'.


    How can I get my GridView to export to excel when I have it within the panel
    and using the updateProgress and ModalProgress panel with it?
    Here is my export code;

    Response.Clear( );
    Response.AddHea der("content-disposition", "attachment ;
    filename=output .xls");
    Response.Charse t = "";
    Response.Conten tType = "applicatio n/ouput.xls";
    System.IO.Strin gWriter stringWrite = new
    System.IO.Strin gWriter();
    System.Web.UI.H tmlTextWriter htmlWrite = new
    HtmlTextWriter( stringWrite);
    gOutput.RenderC ontrol(htmlWrit e);
    Response.Write( stringWrite.ToS tring());
    Response.End();


Working...