如何在asp.net中导出excel表时冻结标题行

时间:2012-11-26 10:47:43

标签: asp.net

string attachment = "attachment; filename=Memberslist.xls";
Response.ClearContent();
Response.AddHeader("content-disposition", attachment);
Response.ContentType = "application/ms-excel";
StringWriter sw = new StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
// Create a form to contain the grid
HtmlForm frm = new HtmlForm();
completeGV.Parent.Controls.Add(frm);
frm.Attributes["runat"] = "server";
frm.Controls.Add(completeGV);
frm.RenderControl(htw);
Response.Write(sw.ToString());
Response.End();

我正在使用上面的代码导出excel表,但我需要在导出excel表时冻结标题行。请帮帮我...这是杀了我......

0 个答案:

没有答案