导出Word! 一些数据库的资料要导出为Word要如何做?我现在知道思路是:先做好Word模板,在需要插值的地方设置一些文档变量,然后从数据库中取出数据,插入域值!但是我不知道如何入手。请给我一个例子参考一下!谢谢! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我们通常做的都是导出到EXCEL,不知为何要导到WORD void ExportExcel(DataSet oDS){Response.Clear(); Response.Charset = "gb2312;"; Response.ContentType = "application/vnd.ms-excel"; System.IO.StringWriter oSW = new System.IO.StringWriter(); HtmlTextWriter oHW = new HtmlTextWriter(oSW); DataGrid oDG = new DataGrid(); oDG.DataSource = oDS.Tables[0]; oDG.DataBind(); oDG.RenderControl(oHW); Response.Write(oSW.ToString()); Response.Flush(); Response.Close(); } 非常谢谢你,把导出Excel给我!可是这个我会呀.多GridView里面导出Word我也知道!我也不想导出的哦,是客户要这样子做的,没有办法.急呀! application/vnd.ms-excel 改成 application/vnd.ms-word 如何自动生成【友善的】密码 请问各位高手是什么的一回事! 字符串成批的替换指定的位置集合 求一分页存储过程、 gridview超连接问题 如何将DataSet中的内容换掉? 做一个用户注册的 但怎么做那个重填按钮 一个很基础但是高难度的SQL问题,请高手们指点啊。。。。。。。。。。。难啊,想了三天了。。。。 mySqlPager.setAttribute( SqlPager1, "DataGrid1", mySql, "1000000-PID", 20); asp.NET中 如何在前台显示一条记录 为什么中文下载链接有的可以,有的不行? 如何使页面最大化,并且隐藏IE的菜单和工具栏?
{
Response.Clear();
Response.Charset = "gb2312;";
Response.ContentType = "application/vnd.ms-excel";
System.IO.StringWriter oSW = new System.IO.StringWriter();
HtmlTextWriter oHW = new HtmlTextWriter(oSW);
DataGrid oDG = new DataGrid();
oDG.DataSource = oDS.Tables[0];
oDG.DataBind();
oDG.RenderControl(oHW);
Response.Write(oSW.ToString());
Response.Flush();
Response.Close();
}