AddHeader和Detlais顶部的Word文件 [英] AddHeader and Detlais top Of the Word file

查看:60
本文介绍了AddHeader和Detlais顶部的Word文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I am Using Fllowing method and Export Word File.I want to Add a  AddHeader and Detlais top Of the Word file.how to do it??
 
  protected void Button1_Click(object sender, EventArgs e)  
    {  
        ExportGridToword();  
    }  
    private void ExportGridToword()  
    {  
        Response.Clear();  
        Response.Buffer = true;  
        Response.ClearContent();  
        Response.ClearHeaders();  
        Response.Charset = "";  
        string FileName = "Vithal" + DateTime.Now +".doc";  
        StringWriter strwritter = new StringWriter();  
        HtmlTextWriter htmltextwrtter = new HtmlTextWriter(strwritter);        
        Response.Cache.SetCacheability(HttpCacheability.NoCache);  
        Response.ContentType ="application/msword";  
        Response.AddHeader("Content-Disposition","attachment;filename=" + FileName);  
        GridView1.GridLines = GridLines.Both;  
        GridView1.HeaderStyle.Font.Bold = true;  
        GridView1.RenderControl(htmltextwrtter);  
        Response.Write(strwritter.ToString());  
        Response.End();      
  
    }

推荐答案

您需要使用适当的API来控制文档,I认为。



这与SQL Server有什么关系?
You need to use the proper APIs to have that level of control over documents, I think.

What on earth does this have to do with SQL Server ?


这篇关于AddHeader和Detlais顶部的Word文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆