关于ActiveX(VC开发)保存到Word文档中,供用户在浏览器保存打印(类似生成报表那样)

hitchr 2005-10-22 11:14:46
我的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();
}
...全文
92 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

4,818

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 图表区
社区管理员
  • 图表区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧