<%@ page contentType="application/vnd.ms-excel; charset=utf-8" %>
<%
response.setHeader("Content-Disposition", "attachment; filename=\"data_list" + (int)(Math.random() * 10000)+ ".xls\"");
%>
<%
String tablestr = "";
tablestr = tablestr + "<table border=\"1\" width=\"100%\" cellpadding=\"5\" cellspacing=\"0\">";
tablestr = tablestr + "<tr>";
tablestr = tablestr + "<td><b>column</td>";
tablestr = tablestr + "<td><b>column</td>";
tablestr = tablestr + "<td><b>column</td>";
tablestr = tablestr + "<td><b>column</td>";
tablestr = tablestr + "<td><b>column</td>";
tablestr = tablestr + "<td><b>column</td>";
tablestr = tablestr + "<td><b>column</td>";
tablestr = tablestr + "</tr>";
tablestr = tablestr + "</tr></table>";
out.print(tablestr );
%>
jsp页面导出excel表格
最新推荐文章于 2024-03-20 11:47:17 发布