码迷,mamicode.com
首页 > Web开发 > 详细

jsp 文件导出到Excel

时间:2017-10-27 20:40:03      阅读:153      评论:0      收藏:0      [点我收藏+]

标签:java代码   byte   eth   pre   tco   chm   set   exp   idp   

Java代码加:
response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-Disposition", "attachment; filename=" + new String((userExpandDto.getRealname() + "学员个人档案").getBytes(),"ISO8859-1") + ".xls");
jsp页面加:
<html xmlns:x="urn:schemas-microsoft-com:office:excel">
<head>
<!-- 显示网格线 -->
<xml>
<x:ExcelWorkbook>
<x:ExcelWorksheets>
<x:ExcelWorksheet>
<x:Name>excel</x:Name>
<x:WorksheetOptions>
<x:Print>
<x:ValidPrinterInfo/>
</x:Print>
</x:WorksheetOptions>
</x:ExcelWorksheet>
</x:ExcelWorksheets>
</x:ExcelWorkbook>
</xml>
<!-- 显示网格线 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>

jsp 文件导出到Excel

标签:java代码   byte   eth   pre   tco   chm   set   exp   idp   

原文地址:http://www.cnblogs.com/gc-note/p/7744892.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!