<%@ page contentType="application/vnd.ms-excel; charset=gbk" %>
<%@ page language="java" pageEncoding="GBK"%>
<%
response.reset();
response.setContentType("application/vnd.ms-excel;charset=GBK");
String filename = new String(("表格名").getBytes("GBK"),"ISO-8859-1");
response.addHeader("Content-Disposition", "filename=" + filename + ".xls");
%>
<html>
<head>
<meta name="Generator" content="Microsoft Excel 11">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body >
<!-- <center><b>表格名</b></center><br> -->
<table border="1" align="center" cellpadding="0" cellspacing="1">
<tr >
<td>
123123
<!--在这里用html写表格内容的代码,可以用jsp代码-->
</td>
</tr>
</table>
</body>
</html>
-
afe authored6bb5cbd2