首页 > Web开发 > 详细

jsp 文件导出到Excel

时间:2017-10-27 20:20:33      阅读:228      评论:0      收藏:0      [点我收藏+]
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

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!