📄 642825.xml
字号:
<?xml version='1.0' encoding='GB2312'?>
<?xml-stylesheet type='text/xsl' href='../csdn.xsl'?>
<Topic>
<Issue>
<PostUserNickName></PostUserNickName>
<rank>一级(初级)</rank>
<ranknum>user1</ranknum>
<credit>100</credit>
<TopicId>642825</TopicId>
<TopicName>请问怎样将JSP网页中的表格导出到EXCEL表中</TopicName>
<PostUserId>228977</PostUserId>
<PostUserName>charlesbird</PostUserName>
<RoomName>JSP</RoomName>
<ReplyNum>6</ReplyNum>
<PostDateTime>2002-4-12 20:53:59</PostDateTime>
<Point>50</Point>
<ReadNum>0</ReadNum>
<RoomId>28</RoomId>
<EndState>2</EndState>
<Content>各位大虾多给些提示吧
</Content>
</Issue>
<Replys>
<Reply>
<PostUserNickName>oop.51.net</PostUserNickName>
<rank>三级(初级)</rank>
<ranknum>user3</ranknum>
<credit>100</credit>
<ReplyID>4240940</ReplyID>
<TopicID>642825</TopicID>
<PostUserId>33026</PostUserId>
<PostUserName>nothing</PostUserName>
<Point>0</Point>
<Content>找个微软的excel处理包
装个ms vj++,在里面找找。</Content>
<PostDateTime>2002-4-13 14:59:03</PostDateTime>
</Reply>
<Reply>
<PostUserNickName>晓彬</PostUserNickName>
<rank>两星(中级)</rank>
<ranknum>star2</ranknum>
<credit>135</credit>
<ReplyID>4251012</ReplyID>
<TopicID>642825</TopicID>
<PostUserId>173450</PostUserId>
<PostUserName>Andrawu</PostUserName>
<Point>0</Point>
<Content>提供一个方法将表格数据提取出来,生成:
xls是用空格分隔的文本文件,保存为.xls;或
csv是用“,”分隔的文本文件,保存为.csv。
</Content>
<PostDateTime>2002-4-14 13:52:02</PostDateTime>
</Reply>
<Reply>
<PostUserNickName>duoduo</PostUserNickName>
<rank>一级(初级)</rank>
<ranknum>user1</ranknum>
<credit>100</credit>
<ReplyID>4283181</ReplyID>
<TopicID>642825</TopicID>
<PostUserId>231904</PostUserId>
<PostUserName>duolai</PostUserName>
<Point>0</Point>
<Content>请问有没有办法在jsp中将数据写入EXCEL模板中,并打印</Content>
<PostDateTime>2002-4-16 13:01:21</PostDateTime>
</Reply>
<Reply>
<PostUserNickName></PostUserNickName>
<rank>一级(初级)</rank>
<ranknum>user1</ranknum>
<credit>100</credit>
<ReplyID>4307296</ReplyID>
<TopicID>642825</TopicID>
<PostUserId>228977</PostUserId>
<PostUserName>charlesbird</PostUserName>
<Point>0</Point>
<Content>用什么方法将数据提取出来呢?
这似乎是关键啊!!??</Content>
<PostDateTime>2002-4-17 17:17:23</PostDateTime>
</Reply>
<Reply>
<PostUserNickName></PostUserNickName>
<rank>一级(初级)</rank>
<ranknum>user1</ranknum>
<credit>100</credit>
<ReplyID>4307442</ReplyID>
<TopicID>642825</TopicID>
<PostUserId>228977</PostUserId>
<PostUserName>charlesbird</PostUserName>
<Point>0</Point>
<Content>那怎么样才能将数据提取出来呢?
这好象是问题的关键啊 ??!!</Content>
<PostDateTime>2002-4-17 17:25:15</PostDateTime>
</Reply>
<Reply>
<PostUserNickName>晓彬</PostUserNickName>
<rank>两星(中级)</rank>
<ranknum>star2</ranknum>
<credit>135</credit>
<ReplyID>4308785</ReplyID>
<TopicID>642825</TopicID>
<PostUserId>173450</PostUserId>
<PostUserName>Andrawu</PostUserName>
<Point>20</Point>
<Content>如果:xls是用空格分隔的文本文件,保存为.xls
可以这样提取。
<%@ page contentType="application/vnd.ms-excel;charset=gb2312"%>
<%
  try {
    String fileName=(String)request.getAttribute("fileName") ;
    String fileNamePath="/ExcelFolder/analyze/"+fileName;
    out.println("<html>");
    out.println("<head>");
	out.println("</head>");
	out.println("<body>");
	response.sendRedirect(fileNamePath);
    out.println("</body>");
	out.println("</html>");
	}catch(Exception ex) {
   }
   %>
</Content>
<PostDateTime>2002-4-17 19:08:03</PostDateTime>
</Reply>
<Reply>
<PostUserNickName>jqb1088</PostUserNickName>
<rank>一级(初级)</rank>
<ranknum>user1</ranknum>
<credit>100</credit>
<ReplyID>4326840</ReplyID>
<TopicID>642825</TopicID>
<PostUserId>233923</PostUserId>
<PostUserName>jqb1088</PostUserName>
<Point>30</Point>
<Content><html>
<style type="text/css"> {
  .showTD {color: #003366; } 
  .hiddenTD {display:none; } 
  .onFocue  {color: #CC66FF;}
  .offFocue {color:#003366;}
}
#floater {
	LEFT: 445px; POSITION: absolute; TOP: 15px; VISIBILITY: visible; WIDTH: 125px; Z-INDEX: 10}
</STYLE>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>
<body>
<div  class="hiddenTD" id="tablers">
<%=JSP网页中的表格%>
</div>
<p>
<object classid="clsid:0002E510-0000-0000-C000-000000000046" id="Spreadsheet1" codebase="file:F:\msowc.cab" width="676" height="388">
  <param name="HTMLURL" value>
  <param name="HTMLData" value="&lt;html xmlns:x=&quot;urn:schemas-microsoft-com:office:excel&quot;
xmlns=&quot;http://www.w3.org/TR/REC-html40&quot;&gt;
&lt;head&gt;
&lt;style type=&quot;text/css&quot;&gt;
&lt;!--tr
	{mso-height-source:auto;}
td
	{white-space:nowrap;}
.wcC390352
	{white-space:nowrap;
	font-family:宋体;
	mso-number-format:General;
	font-size:auto;
	font-weight:auto;
	font-style:auto;
	text-decoration:auto;
	mso-background-source:auto;
	mso-pattern:auto;
	mso-color-source:auto;
	text-align:general;
	vertical-align:bottom;
	border-top:none;
	border-left:none;
	border-right:none;
	border-bottom:none;
	mso-protection:locked;}
--&gt;
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;x:ExcelWorkbook&gt;
  &lt;x:ExcelWorksheets&gt;
   &lt;x:ExcelWorksheet&gt;
    &lt;x:OWCVersion&gt;9.0.0.3821&lt;/x:OWCVersion&gt;
    &lt;x:Label Style='border-top:solid .5pt silver;border-left:solid .5pt silver;
     border-right:solid .5pt silver;border-bottom:solid .5pt silver'&gt;
     &lt;x:Caption&gt;Microsoft Office Spreadsheet&lt;/x:Caption&gt;
    &lt;/x:Label&gt;
    &lt;x:Name&gt;Sheet1&lt;/x:Name&gt;
    &lt;x:WorksheetOptions&gt;
     &lt;x:Selected/&gt;
     &lt;x:Height&gt;7620&lt;/x:Height&gt;
     &lt;x:Width&gt;15240&lt;/x:Width&gt;
     &lt;x:TopRowVisible&gt;0&lt;/x:TopRowVisible&gt;
     &lt;x:LeftColumnVisible&gt;0&lt;/x:LeftColumnVisible&gt;
     &lt;x:ProtectContents&gt;False&lt;/x:ProtectContents&gt;
     &lt;x:DefaultRowHeight&gt;210&lt;/x:DefaultRowHeight&gt;
     &lt;x:StandardWidth&gt;2389&lt;/x:StandardWidth&gt;
    &lt;/x:WorksheetOptions&gt;
   &lt;/x:ExcelWorksheet&gt;
  &lt;/x:ExcelWorksheets&gt;
  &lt;x:MaxHeight&gt;80%&lt;/x:MaxHeight&gt;
  &lt;x:MaxWidth&gt;80%&lt;/x:MaxWidth&gt;
 &lt;/x:ExcelWorkbook&gt;
&lt;/xml&gt;&lt;![endif]--&gt;
&lt;table class=wcC390352 x:str&gt;
 &lt;col width=&quot;56&quot;&gt;
 &lt;tr height=&quot;14&quot;&gt;
  &lt;td&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;/table&gt;
&lt;/body&gt;
&lt;/html&gt;
">
  <param name="DataType" value="HTMLDATA">
  <param name="AutoFit" value="0">
  <param name="DisplayColHeaders" value="-1">
  <param name="DisplayGridlines" value="-1">
  <param name="DisplayHorizontalScrollBar" value="-1">
  <param name="DisplayRowHeaders" value="-1">
  <param name="DisplayTitleBar" value="-1">
  <param name="DisplayToolbar" value="-1">
  <param name="DisplayVerticalScrollBar" value="-1">
  <param name="EnableAutoCalculate" value="-1">
  <param name="EnableEvents" value="-1">
  <param name="MoveAfterReturn" value="-1">
  <param name="MoveAfterReturnDirection" value="0">
  <param name="RightToLeft" value="0">
  <param name="ViewableRange" value="1:65536">
</object>
</p>
</body>
</html>
<script language="javascript">
  Spreadsheet1.HTMLData = tablers.innerHTML ;
</script>
调试通过,但是JSP网页中的表格不能太大</Content>
<PostDateTime>2002-4-18 17:48:37</PostDateTime>
</Reply>
</Replys>
</Topic>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -