Я добавляю таблицу сетки в Excel и добавляю заголовок в Excel.
string subject = lbl_Subj.Text;
Response.Clear();
Response.Buffer = true;
Response.ClearHeaders();
Response.AddHeader("Cache-Control", "no-store, no-cache");
Response.AddHeader("content-disposition", "attachment;filename=" + subject + "-Status");
Response.Charset = "";
this.EnableViewState = false;
Response.ContentType = "application/vnd.ms-excel";
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
Grid_UserTable.RenderControl(htmlWrite);
rptList.RenderControl(htmlWrite);
Response.Write(stringWrite.ToString());
Response.End();
Как мне добавить текст в Excel, я хочу добавить строку вроде
string add="this is the text I want to add to the excel";