Ext 打印 现根据grid 中的数据,导出一份文件(word),打印出来. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <%@ page language="java" pageEncoding="gbk"%> <% String path = request.getContextPath(); String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; response.setHeader("Content-disposition", "attachment; filename=word.doc"); %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <base href="<%=basePath%>"> <title>My JSP 'word.jsp' starting page</title> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0"> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="This is my page"> </head> <body> 第一页 <span lang=EN-US style='font-size: 10.5pt; mso-bidi-font-size: 12.0pt; font-family: 'Times New Roman';mso-fareast-font-family:宋体;mso-font-kerning:1.0pt;mso-ansi-language:EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA'> <br clear=all style='page-break-before: always'> </span> 第二页 </body> </html> <%@ page language="java" pageEncoding="gbk"%><% String path = request.getContextPath(); String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; response.setHeader("Content-disposition", "attachment; filename=word.doc");%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html> <head> <base href="<%=basePath%>"> <title>My JSP 'word.jsp' starting page</title> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0"> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="This is my page"> </head> <body> 第一页 <span lang=EN-US style='font-size: 10.5pt; mso-bidi-font-size: 12.0pt; font-family: 'Times New Roman';mso-fareast-font-family:宋体;mso-font-kerning:1.0pt;mso-ansi-language:EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA'> <br clear=all style='page-break-before: always'> </span> 第二页 </body></html> 你只需要把数据显示在这个页面就可以了就是说你点击导出的时候,传递一个参数到后台,然后返回这个页面。页面显示数据就是导出word的数据本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/IBM_hoojo/archive/2010/05/27/5628765.aspx Css可否改变滚动条的样式? 求JavaScript正则!id,id,id的形式。 通过Ajax 请求刷新的页面元素如何添加事件? 树状列表在本机调试的时候,显示不正常;用IE浏览的时候却正常.怎么回事啊? 菜鸟求个js写个下拉框,应该简单. onclick 问题 又有个问题,请大家帮忙。在线等,解决麻烦给分 新手请教 有关使用JS调整表格属性的问题 自学编写一个java 请教一下哪个地方不对 JavaScript复选框特效 FF下也没getBoxObjectFor确有MessageEvent
<%@ page language="java" pageEncoding="gbk"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
response.setHeader("Content-disposition", "attachment; filename=word.doc");
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'word.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
</head>
<body>
第一页
<span lang=EN-US
style='font-size: 10.5pt; mso-bidi-font-size: 12.0pt; font-family: 'Times New Roman';mso-fareast-font-family:宋体;mso-font-kerning:1.0pt;mso-ansi-language:EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA'>
<br clear=all style='page-break-before: always'> </span> 第二页
</body>
</html>
<%@ page language="java" pageEncoding="gbk"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
response.setHeader("Content-disposition", "attachment; filename=word.doc");
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>"> <title>My JSP 'word.jsp' starting page</title> <meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page"> </head> <body>
第一页
<span lang=EN-US
style='font-size: 10.5pt; mso-bidi-font-size: 12.0pt; font-family: 'Times New Roman';mso-fareast-font-family:宋体;mso-font-kerning:1.0pt;mso-ansi-language:EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA'>
<br clear=all style='page-break-before: always'> </span> 第二页
</body>
</html>
你只需要把数据显示在这个页面就可以了
就是说你点击导出的时候,传递一个参数到后台,然后返回这个页面。页面显示数据就是导出word的数据本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/IBM_hoojo/archive/2010/05/27/5628765.aspx