- 如上图我导出来他会带一个页码
- 我怎样导出可以不带页码
- 我的想法是
- 在现在这个方法里面 参数里面删掉最后一个tr标签在导出
- 但是不知道怎么写
- 各位大佬有什么方法 或者知道怎么写嘛
private void ExportGridViewForUTF8(GridView GridView, string filename)
{
//SGridView.AllowPaging = false; //清除分页
string attachment = "attachment; filename=" + filename;
Response.ClearContent();
Response.Buffer = true;
Response.AddHeader("content-disposition", attachment);
Response.Charset = "UTF-8";
Response.ContentEncoding = System.Text.Encoding.GetEncoding("UTF-8");
Response.ContentType = "application/ms-excel";
System.IO.StringWriter sw = new System.IO.StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
GridView.RenderControl(htw);
Response.Output.Write(sw.ToString());
Response.Flush();
Response.End();
//SGridView.AllowSorting = true; //恢复分页
}