asp.net将页面中的表格导出word时如何将表格中的图片导出 asp.net将页面中的表格导出word时如何将表格中的图片导出!!大神吗,帮忙啊!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 private void TableExport(System.Web.UI.HtmlControls.HtmlTable tab, string fileName, string typeName) { System.Web.HttpResponse httpResponse = _InvokePage.Response; httpResponse.Clear(); httpResponse.Buffer = true; httpResponse.Charset = "GB2312"; //Response.Charset = "UTF-8"; httpResponse.Write("<meta http-equiv=Content-Type content=text/html;charset=GB2312>"); httpResponse.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8).ToString()); httpResponse.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312"); httpResponse.ContentType = typeName; _InvokePage.EnableViewState = false; StringWriter tw = new StringWriter(); System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(tw); tab.RenderControl(hw); httpResponse.Write(@"<style type='text/css'>.No3_Table{border: 1px solid #a6caea;border-collapse:collapse; } .No3_Table td, .No3_Table th{border: 1px solid #000000;margin-left: 40px;text-align: center;font-size: 12px;} .No3_Td_Bg{font-size: 12px;background-color: #f5ffff;color:#3f5151; height: 30px;text-align: center;vertical-align: middle;line-height:1.5;} .nr{font-size:13px;color:Black;font-family:宋体; line-height:29px;} </style>"); httpResponse.Write(tw.ToString()); httpResponse.End(); }我是用这种方式 生成的word 把表格转换成htmltable,在生成的word。 直接导出的是不行的你看看看看这篇文章http://blog.csdn.net/net_lover/article/details/1702797 Chinajiyong提供的方法没弄好,还有高手给指点一下吗! SQL 2005 连接检测的问题 C# 如何查询变量所对应的内存地址? C# 增加ACCESS数据出问题了,请大大帮忙看看。 关于用户控件传参的问题。。 需要一个把主键盘的回车键改成字母z,把小键盘的确定键改成a的控制台程序。 跪求,跪求,TCP连接 无法从传输中读取数据错误 结构的用法 中奖几率 URL地址获取方法 求助,通过ODBC连接interbase怎么做? 程序集错误。急!急!急!在线等!!!!!! DAL层调用UI层的参数
{
System.Web.HttpResponse httpResponse = _InvokePage.Response;
httpResponse.Clear();
httpResponse.Buffer = true;
httpResponse.Charset = "GB2312";
//Response.Charset = "UTF-8";
httpResponse.Write("<meta http-equiv=Content-Type content=text/html;charset=GB2312>");
httpResponse.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8).ToString());
httpResponse.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
httpResponse.ContentType = typeName;
_InvokePage.EnableViewState = false;
StringWriter tw = new StringWriter();
System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(tw);
tab.RenderControl(hw);
httpResponse.Write(@"<style type='text/css'>.No3_Table{border: 1px solid #a6caea;border-collapse:collapse; }
.No3_Table td, .No3_Table th{border: 1px solid #000000;margin-left: 40px;text-align: center;font-size: 12px;}
.No3_Td_Bg{font-size: 12px;background-color: #f5ffff;color:#3f5151; height: 30px;text-align: center;vertical-align: middle;line-height:1.5;}
.nr{font-size:13px;color:Black;font-family:宋体; line-height:29px;}
</style>");
httpResponse.Write(tw.ToString());
httpResponse.End();
}
我是用这种方式 生成的word 把表格转换成htmltable,在生成的word。
你看看看看这篇文章http://blog.csdn.net/net_lover/article/details/1702797