您的位置:首页 > 编程语言 > ASP

asp生成Excel最简单的方法

2006-05-19 09:30 489 查看
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>CreateExcel</title>
</head>

<body>
<%
action=trim(request("action"))
if action="create" then
Response.ContentType = "application/ms-download"
Response.AddHeader "content-disposition", "attachment; filename=Table" & date() & ".xls"
else
%>
<form action="?action=create" method="post" name="form1">
<div align="right">
<input name="Submit" type="submit" value="生成Excel">
</div>
</form>

<%
end if
%>
<table width="98%" border="1" cellpadding="0" cellspacing="0" bordercolor="#000000">
<tr>
<td height="35" colspan="3" align="center">生成Excel示例</td>
</tr>
<tr>
<td align="center">姓名</td>
<td align="center">电话</td>
<td align="center">备注</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</body>
</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: