易截截图软件、单文件、免安装、纯绿色、仅160KB

asp将table生成excel文件xls

 <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
if request("action")=1 then
 Response.ContentType="application/ms-excel"
 Response.AddHeader "content-disposition","attachment;filename=www.xls"
end if
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
table {
 border-top:1px solid #003399;
 border-left:1px solid #003399;
}
td {
 border-right:1px solid #003399;
 border-bottom:1px solid #003399;
}
thead {
 background-color:#000066;
 font-weight:bold;
 padding:5px;
 color:#FFFFFF;
}
</style>
<script  language="javascript"> 
function  tableToExcel(){
 location.href='?action=1';

</script>
</head>
<body>
<input type="button" value="导出数据" onclick="tableToExcel()" />
<%
ConnStr="..." 
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open connstr
set rs = server.CreateObject("adodb.recordset")
rs.open "select top 10 * from [你的表名]",conn,1,1
if not (rs.eof and rs.bof) then
 column = rs.fields.count
 response.Write("<table cellpadding='0' cellspacing='0'>")
 response.Write("<thead><td>序号</td>")
 for each f in rs.fields
  response.Write("<td>" & f.name & "</td>")
 next
 response.Write("</thead>")
 for j = 1 to rs.recordcount
  if j > 5 then '在第五条的时候隐藏数据,经过测试如果是display为none的数据是不会导出来的
   response.Write("<tr style='display:none'>")
  else
   response.Write("<tr>")
  end if
  response.Write("<td>" & j &


相关文档:

做ASP小偷程序

 (一)如何截取指定区域的HTML代码?
  (对方网站的HTML代码在哪儿看?晕:IE浏览器>>查看>>源文件。不要告诉我你不知道IE是什么!),例如我只想获取以下HTML代码中"<td>"和"</td>"之间的的文字部分:
<html>
<title>网站爱好者__http://www.wwwfan.cn</title>
< ......

居中,表格宽度——ASP格式

一、修改格式:调整表头居左;
 <!--原来格式-->
/*说明:把整个表头和页面内容居中,当页面内容较长时,表头也居中,看起来像表头错位。*/
<div style="position: absolute;top:3px;">
<center>
<!--#include file="inc/glfcd.inc"-->
<br>
    标题
</br& ......

asp 连接 mysql 代码

 连接代码1直接输入
<%
Dim my_conn, sql,rs
Set my_conn = createobject("ADODB.Connection")
my_conn.open = "DRIVER={MySQL ODBC 3.51 Driver};"_
& "SERVER=localhost;"_ '服务器名
& "DATABASE=mybase;"_ '数据库名
& "UID=root;PWD=111; OPTION=35;" '用户名和密码
Set rs = Server.Crea ......

as3 与 服务端ASP 通信

 var loader:URLLoader = new URLLoader();
var url:URLRequest = new URLRequest("test.asp");
url.method = URLRequestMethod.POST;
var values:URLVariables = new URLVariables();
values.message="hello im flash!";
url.data = values;
loader.dataFormat = URLLoaderDataFormat.VARI ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号