I am exporting to excel from GridView which works fine on localhost but not on the production server. I am guessing there needs to be some excel component installed on the server. Does anyone know what I need to install to get this working?
GridViewAllApps.DataBind();
Response.Clear();
Response.Buffer = true;
Response.AddHeader("Content-Disposition", "attachment;filename=Applications.xls");
Response.Charset = "";
Response.ContentType = "application/vnd.ms-excel";
System.IO.StringWriter sw = new System.IO.StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(sw);
GridViewAllApps.RenderControl(hw);
string style = @"<style> .textmode {mso-number-format:\@; } </style>";
Response.Write(style);
Response.Output.Write(sw.ToString());
Response.Flush();
Response.End();