asp.net将页面中的表格导出word时如何将表格中的图片导出!!
大神吗,帮忙啊!!

解决方案 »

  1.   

    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。
      

  2.   

    直接导出的是不行的
    你看看看看这篇文章http://blog.csdn.net/net_lover/article/details/1702797
      

  3.   

    Chinajiyong提供的方法没弄好,还有高手给指点一下吗!