请各位老大指导一下:
我想实现在JSP中查询完数据后调用EXCEL显示在客户端,而不是直接以网页中表格的格式显示!多谢!如果分数不够我可以另外在给!
我想实现在JSP中查询完数据后调用EXCEL显示在客户端,而不是直接以网页中表格的格式显示!多谢!如果分数不够我可以另外在给!
解决方案 »
- 博客空间提问没人去,转到这里.(fckeditor文章编辑器的小问题)
- JSP日期
- 如何用java代码来限制带宽?
- 问个JAVA和JAVASCRIPT的问题
- [ 请教 ] 如何在java代码中执行关闭tomcat服务器的操作
- 不知道应该如何将表单里的值插入数据库,请大家帮忙(我是菜鸟)
- 小问题,请各位看看,帮忙解决一下
- 各位老大,我现在急需一套JSP+MYsql的论坛源码。能提示提示不》?
- jsp和xml是如何结合的?(新手上路)
- SSH2框架下,十几条用户数据单表查询速度太慢
- 有个问题请教,关于useBean,我是初学者,问题应该不难,但我却不会:(
- 太简单了,可我就是不会,我是不是有点.........(有代码),大家快来呀!!!!
你在tomcat/conf/web.xml 中加上下面那段试试
<mime-mapping>
<extension>xsl</extension>
<mime-type>text/xml</mime-type>
</mime-mapping>
<extension>xls</extension>
<mime-type>application/vnd.ms-excel
</mime-type>
</mime-mapping>sorry 应该是这句
<%@ page language="java"%>
<%@ page import="wuye.database.*,java.sql.*,wuye.util.*" %>
<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=GB2312">
<meta name=ProgId content=Excel.Sheet>
<meta name=Generator content="Microsoft Excel 9">
<link rel=File-List href="./roominfor.files/filelist.xml">
<link rel=Edit-Time-Data href="./roominfor.files/editdata.mso">
<link rel=OLE-Object-Data href="./roominfor.files/oledata.mso">
<title>房间信息表</title>
<!--[if gte mso 9]><xml>
<o:DocumentProperties>
<o:Author>chenansheng</o:Author>
<o:LastAuthor>chenansheng</o:LastAuthor>
<o:Created>2004-03-24T10:42:08Z</o:Created>
<o:LastSaved>2004-03-24T11:08:51Z</o:LastSaved>
<o:Company>agrs</o:Company>
<o:Version>9.2812</o:Version>
</o:DocumentProperties>
<o:OfficeDocumentSettings>
<o:DownloadComponents/>
<o:LocationOfComponents HRef="file:///F:/msowc.cab"/>
</o:OfficeDocumentSettings>
</xml><![endif]-->
<style>
<!--table
{mso-displayed-decimal-separator:"\.";
mso-displayed-thousand-separator:"\,";}
@page
{margin:1.0in .75in 1.0in .75in;
mso-header-margin:.5in;
mso-footer-margin:.5in;}
.font0
{color:windowtext;
font-size:12.0pt;
font-weight:400;
font-style:normal;
text-decoration:none;
font-family:宋体;
mso-generic-font-family:auto;
mso-font-charset:134;}
.font6
{color:windowtext;
font-size:12.0pt;
font-weight:400;
font-style:normal;
text-decoration:none;
font-family:"Times New Roman", serif;
mso-font-charset:0;}
tr
{mso-height-source:auto;
mso-ruby-visibility:none;}
col
{mso-width-source:auto;
mso-ruby-visibility:none;}
br
{mso-data-placement:same-cell;}
.style0
{mso-number-format:General;
text-align:general;
vertical-align:bottom;
white-space:nowrap;
mso-rotate:0;
mso-background-source:auto;
mso-pattern:auto;
color:windowtext;
font-size:12.0pt;
font-weight:400;
font-style:normal;
text-decoration:none;
font-family:宋体;
mso-generic-font-family:auto;
mso-font-charset:134;
border:none;
mso-protection:locked visible;
mso-style-name:常规;
mso-style-id:0;}
td
{mso-style-parent:style0;
padding-top:1px;
padding-right:1px;
padding-left:1px;
mso-ignore:padding;
color:windowtext;
font-size:12.0pt;
font-weight:400;
font-style:normal;
text-decoration:none;
font-family:宋体;
mso-generic-font-family:auto;
mso-font-charset:134;
mso-number-format:General;
text-align:general;
vertical-align:bottom;
border:none;
mso-background-source:auto;
mso-pattern:auto;
mso-protection:locked visible;
white-space:nowrap;
mso-rotate:0;}
ruby
{ruby-align:left;}
rt
{color:windowtext;
font-size:9.0pt;
font-weight:400;
font-style:normal;
text-decoration:none;
font-family:宋体;
mso-generic-font-family:auto;
mso-font-charset:134;
mso-char-type:none;
display:none;}
-->
</style>
<!--[if gte mso 9]><xml>
<x:ExcelWorkbook>
<x:ExcelWorksheets>
<x:ExcelWorksheet>
<x:Name>Sheet1</x:Name>
<x:WorksheetOptions>
<x:DefaultRowHeight>285</x:DefaultRowHeight>
<x:Print>
<x:ValidPrinterInfo/>
<x:PaperSizeIndex>9</x:PaperSizeIndex>
<x:HorizontalResolution>600</x:HorizontalResolution>
<x:VerticalResolution>600</x:VerticalResolution>
</x:Print>
<x:Selected/>
<x:Panes>
<x:Pane>
<x:Number>3</x:Number>
<x:ActiveRow>2</x:ActiveRow>
<x:ActiveCol>1</x:ActiveCol>
</x:Pane>
</x:Panes>
<x:ProtectContents>False</x:ProtectContents>
<x:ProtectObjects>False</x:ProtectObjects>
<x:ProtectScenarios>False</x:ProtectScenarios>
</x:WorksheetOptions>
</x:ExcelWorksheet>
<x:ExcelWorksheet>
<x:Name>Sheet2</x:Name>
<x:WorksheetOptions>
<x:DefaultRowHeight>285</x:DefaultRowHeight>
<x:Panes>
<x:Pane>
<x:Number>3</x:Number>
<x:ActiveCol>1</x:ActiveCol>
<x:RangeSelection>B:B</x:RangeSelection>
</x:Pane>
</x:Panes>
<x:ProtectContents>False</x:ProtectContents>
<x:ProtectObjects>False</x:ProtectObjects>
<x:ProtectScenarios>False</x:ProtectScenarios>
</x:WorksheetOptions>
</x:ExcelWorksheet>
<x:ExcelWorksheet>
<x:Name>Sheet3</x:Name>
<x:WorksheetOptions>
<x:DefaultRowHeight>285</x:DefaultRowHeight>
<x:ProtectContents>False</x:ProtectContents>
<x:ProtectObjects>False</x:ProtectObjects>
<x:ProtectScenarios>False</x:ProtectScenarios>
</x:WorksheetOptions>
</x:ExcelWorksheet>
</x:ExcelWorksheets>
<x:WindowHeight>9225</x:WindowHeight>
<x:WindowWidth>14940</x:WindowWidth>
<x:WindowTopX>240</x:WindowTopX>
<x:WindowTopY>120</x:WindowTopY>
<x:ProtectStructure>False</x:ProtectStructure>
<x:ProtectWindows>False</x:ProtectWindows>
</x:ExcelWorkbook>
</xml><![endif]-->
</head>