当前位置: 代码迷 >> ASP.NET >> 导出到word时,怎么添加页眉页脚
  详细解决方案

导出到word时,怎么添加页眉页脚

热度:9535   发布时间:2013-02-25 00:00:00.0
导出到word时,如何添加页眉页脚
C# code
        string FileName = “sssssss.doc”;        HttpContext.Current.Response.Charset = "GB2312";        HttpContext.Current.Response.ContentEncoding = Encoding.UTF8;        HttpContext.Current.Response.ContentType = "application/ms-winword";        HttpContext.Current.Response.AppendHeader("Content-disposition", "attachment;filename=" + HttpUtility.UrlEncode(FileName, Encoding.UTF8).ToString());        //HttpContext.Current.Response.        //Lb_Const[0][10].Page.EnableViewState = false;        StringWriter sw = new StringWriter();        HtmlTextWriter tw = new HtmlTextWriter(sw);        //Label lb = null;        //lb = (Label)this.Page.FindControl("Label1");        //if (lb != null) { lb.RenderControl(tw); }        this.Label1.RenderControl(tw);        string css_txt = "<style>" + Css_read() + "</style>";        HttpContext.Current.Response.Write(sw.ToString());        HttpContext.Current.Response.End();


这样可以输出label的内容到word
现在是想加上一个页眉页脚,该怎么实现呢?

------解决方案--------------------------------------------------------
导出Word
  相关解决方案