解决方案 »

  1.   

    可以直接页面导出的办法,将不需要导出的元素隐藏。
     public void Export()
            {
                string fileName = HttpUtility.UrlEncode("test.xls");
                Response.Clear();
                Response.Buffer = true;
                Response.AppendHeader("Content-Disposition", "attachment;filename=" + fileName);
                Response.ContentEncoding = System.Text.Encoding.UTF8;
                Response.ContentType = "application/vnd.ms-excel";
                this.EnableViewState = false;
            }
      

  2.   

    http://www.cnblogs.com/jeffwongishandsome/archive/2009/11/15/1602824.html