关于ActiveX(VC开发)保存到Word文档中,供用户在浏览器保存打印(类似生成报表那样)
我的aspx页面有ActiveX图形显示控件和图片,把它转换为word时,我希望控件和图片都能成功显示到word文档里面。如果单单转换文字和普通的服务器控件(如按钮),一点问题都没有,但就是ActiveX控件和图片搞不定.ActiveX控件虽然可以显示,但是它的图谱信息全没了,我想先把它抓下来变为图片格式,然后放到word里面,怎么弄啊?高手指教!
代码如下:
private void ShowWord()
{
HttpContext.Current.Response.AppendHeader("Content-Disposition","attachment;filename=xx.doc");
HttpContext.Current.Response.Charset ="UTF-8";
HttpContext.Current.Response.ContentEncoding =System.Text.Encoding.Default;
HttpContext.Current.Response.ContentType ="application/ms-word ";
Page.EnableViewState =false;
System.IO.StringWriter tw = new System.IO.StringWriter() ;
System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter (tw);
this.Page.RenderControl(hw);
HttpContext.Current.Response.Write(tw.ToString());
HttpContext.Current.Response.End();
}