页面打印问题和页面内容输出word文档问题求解 要求页面具有打印功能,纸张大小为A4并且当前打印页面能够另存为word文档 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 可以用水晶报表来做吧,或者用 CSS 样式把网页展示为象 WORD 表格那样 就web页面打印的功能吧,你们谁晓得,告诉我,能把整个页面显示的内容打印到A4的纸上就可以了 用工具做好了 像是FineReport,水晶啊 支持word excel pdf导入导出的 很简单的 页面打印: <object id="WebBrowser" name="WebBrowser" width="0" height="0" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></object><input class="btnPrint" style="width: 90px" type="button" value="打印预览" onclick="WebBrowser.ExecWB(7, 1);" /> 页面导出Word Response.AppendHeader("Content-Disposition","attachment;filename=result.doc"); Response.ContentType = "application/ms-word"; Response.Charset = "UTF-8"; Response.ContentEncoding = System.Text.Encoding.UTF8; //关闭控件的视图状态 this.Page.EnableViewState =false; //初始化HtmlWriter System.IO.StringWriter writer = new System.IO.StringWriter() ; System.Web.UI.HtmlTextWriter htmlWriter = new System.Web.UI.HtmlTextWriter(writer); // 要导出的控件,这里用this,当前页的所有内容. this.RenderControl(htmlWriter); //输出 Response.Write(writer.ToString()); Response.End(); 字符串处理 求C#开源框架 如何通过一个日期获取这个日期 周 的所有数据??(WebForm) 怎样找到C#程序的入口处? 新手我再问个问题 关于发布网站的 呕血推荐一个VS.Net下不错的报表构件 关于显示时间格式的问题 ArLi2003、redbb、bitsbird、qiuji一定要进,有关多线程的问题 问个弱智的问题 高手帮忙!!!为什么线程开始了,就杀不掉了? panel中内嵌文件浏览器 我自己第一次写登录代码,合不合理,怎么样来简化,注释是按我自己的理解写的,请给予纠正.
<input class="btnPrint" style="width: 90px" type="button" value="打印预览" onclick="WebBrowser.ExecWB(7, 1);" />
Response.ContentType = "application/ms-word";
Response.Charset = "UTF-8";
Response.ContentEncoding = System.Text.Encoding.UTF8; //关闭控件的视图状态
this.Page.EnableViewState =false; //初始化HtmlWriter
System.IO.StringWriter writer = new System.IO.StringWriter() ;
System.Web.UI.HtmlTextWriter htmlWriter = new System.Web.UI.HtmlTextWriter(writer);
// 要导出的控件,这里用this,当前页的所有内容.
this.RenderControl(htmlWriter); //输出
Response.Write(writer.ToString());
Response.End();