ASPµ¼³öÊý¾Ýµ½excel
×î½ü×öÒ»¸öÓÃasp×öµÄÍøÕ¾ºǫ́µÄÊý¾Ýµ¼³ö¹¦ÄÜʱ,google,baiduÁ˺ܶà,µ«ÊǶàÊý¶¼ÊÇתÔØ,´úÂë´ó¸Å¶¼Ò»Ñù,µ«ÊǾÍÊDZ¨´í,×îºóÓÐÈË˵ͨ¹ýÉèÖÃMIMEÀàÐͺͽ¨Á¢Ä£°å,×îºóÕûÀí,²âÊÔÎÊÌâÖÕÓÚ½â¾ö.¹Ø¼üµÄµØ·½ÓÐÒÔϼ¸µã:
1):MIMEÀàÐÍÒªÉèÖÃÕýÈ·,ÈçÒª°ÑDBÖбí(»ò±íÖÐÖ¸¶¨×Ö¶Î)µÄÊý¾Ýµ¼³ö³Éexel¸ñʽʱ,Í·²¿µÄMEMIÀàÐ͵ÄÉèÖÃÊÇ:
<%
Response.Expires = 0
Response.ContentType="application/vnd.ms-excel"
Response.AddHeader "content-disposition","inline; filename=exportDataName.xls"
%>
β²¿µÄMIMEÀàÐ͵ÄÉèÖÃ:
<%
Response.ContentType="application/vnd.ms-excel"
Response.AddHeader "content-disposition","attachment filename=exportDataName.xls"
rs.close
set rs=nothing
%>
×¢::exportDataNameΪµ¼³öexelʱҪ±£´æµÄÎļþÃû,×Ô¼º¿ÉÒÔ×Ô¶¨Òå,±ÈÈçÒÔyyyy-MM-ddÐÎʽ±£´æ,ÒÔÉÏÍ·²¿ÐÅÏ¢µÄÉèÖÃ,¼´MIMEÀàÐ͵ÄÉèÖúÍJAVA´úÂëÖеÄÎļþÏÂÔØÉèÖÃÒ»Ñù,ÆäËüµÄÀàÐÍÈç·¨ÅÚÖÆ.
2)Ä£°åµÄ×Ö¶ÎÉèÖÃÒ»¶¨ÒªºÍ´Ó±íÖжÁ³öµÄÒªµü´úµÄÒ»ÖÂ.
xls.asp´úÂëÈçÏ£º
<!--#include file="../Inc/Conn.asp"-->
<!--#include file="../Inc/Function.asp"-->
<%
function times_gs(times)
dim years,months,days
years=year(times)
months=month(times)
if len(months)=1 then
months="0"&months
end if
days=day(times)
if len(days)=1 then
days="0"&days
end if
times_gs=years&"-"&months&"-"&days
end function
'ÓÃÓÚ²éѯ¼Ç¹ýµÄµ¼³ö£¬µ±È»¿ÉÒÔͨ¹ý¸÷ÖÖ·½Ê½´«µÝÖµµ½Õâ¸öÒ³Ã棬ÎÒÊÇͨ¹ýbuttonµÄonlick£º±íµ¥Ãû.action='xls.asp?action=srh<%=strpage%>£¬strpageÓÃÓÚËÑË÷ʱµÄÏî
Ô´ÂëÈçÏ£º
riqi = trim(request("riqi"))
riqi2 = trim(request("riqi2"))
danhao = trim(request("danhao"))
wuliu = trim(request("wuliu"))
kehu = trim(request("kehu"))
jbr = trim(request("jingbanren"))
if riqi<>"" and riqi2<>"" then
sql_riqi = "and riqi between #"&riqi&"# and #"&riqi2&"#"
end if
if danhao<>"" then
sql_danhao = " and danhao='"&danhao&"'"
end if
if wuliu<>"" then
sql_wuliu = " and wuliu like '%"&wuliu&"%'"
end if
if kehu<>"" then
sql_kehu = " and kehu like '%"&kehu&a
Ïà¹ØÎĵµ£º
ÔÚÌض¨Ìõ¼þÏ£¬Äú¿ÉÄÜÐèÒª±Ü¿ªÑéÖ¤¡£ÀýÈ磬Äú¿ÉÄܾßÓÐÒ»¸öÒ³Ã棬¼´Ê¹Óû§Ã»ÓÐÕýÈ·ÌîдËùÓÐÑéÖ¤×ֶΣ¬Ò²Ó¦¸Ã¿ÉÒÔ·¢ËÍÒ³¡£Äú¿ÉÒÔÉèÖà ASP.NET ·þÎñÆ÷¿Ø¼þÀ´±Ü¿ª¿Í»§¶ËºÍ·þÎñÆ÷µÄÑéÖ¤£¬¶ø²»Ö»ÊÇ¿Í»§¶ËÑéÖ¤¡£
°²È«ËµÃ÷£º ĬÈÏÇé¿öÏ£¬ASP.NET ÍøÒ³Ö´ÐÐÇëÇóÑéÖ¤ÒÔÈ·±£Óû§ÊäÈëÄÚÈݲ»°üº¬½Å±¾» ......
ĬÈÏÇé¿öÏ£¬ÔÚÒ³»Ø·¢µ½·þÎñÆ÷ʱ¡¢Ò³³õʼ»¯Ö®ºó£¨¼´ÊÓͼ״̬ºÍ»Ø·¢Êý¾ÝÒÑ´¦ÀíÖ®ºó£©ºÍµ÷ÓÃʼþ´¦Àí´úÂë֮ǰ£¬ASP.NET ÑéÖ¤¿Ø¼þ½«×Ô¶¯Ö´ÐÐÑéÖ¤¡£Èç¹ûä¯ÀÀÆ÷Ö§³Ö¿Í»§¶Ë½Å±¾£¬¿Ø¼þÒ²¿ÉÒÔÔÚä¯ÀÀÆ÷ÖÐÖ´ÐÐÑéÖ¤¡£
µ«ÊÇ£¬ÓÐʱÄú¿ÉÄÜÐèÒªÒÔ±à³Ì·½Ê½Ö´ÐÐÑéÖ¤¡£ÔÚÒÔÏÂÇé¿öÏ£¬Äú¿ÉÄÜÐèҪͨ¹ý±à³ÌÀ´½ ......
±¾ÑÝÁ·Í¨¹ýʹÓôúÂëе÷ͬһҳÉϵÄÁ½¸ö²Ëµ¥£¬ÑÝʾÈçºÎÒÔ±à³Ì·½Ê½Ê¹Óà ASP.NET Menu ¿Ø¼þ¡£
¿ÉÒÔʹÓà ASP.NET Menu ¿Ø¼þΪÍøÕ¾´´½¨µ¼º½²Ëµ¥¡£ÔÚ±¾ÑÝÁ·ÖУ¬½«¿¼²ì ASP.NET Menu ¿Ø¼þµÄ±à³Ì·½Ã棬²¢´´½¨Á½¸öÐͬ¹¤×÷µÄ²Ëµ¥£¬ËüÃǶ¼°ó¶¨µ½Í¬Ò»¸ö Web.sitemap Îļþ¡£µÚÒ»¸ö²Ëµ¥ÊǾ²Ì¬ÏÔʾµÄÀà±ð£¨Èç²úÆ·¡¢·þÎñºÍÖ§³Ö£©²Ëµ¥¡£Ë ......
dataurl=Server.MapPath("menutree.mdb")'Êý¾Ý¿âµØÖ·
dim conn,strQuery,rs
set conn = server.CreateObject("adodb.connection")
conn.Open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE="&dataurl
strQuery="select * from menufun"
set rs=server.createobject("adodb.recordset")
rs.open strQuery,conn,1 ......
ÒÔwin2003²Ù×÷ϵͳ£¬Ó²Å̲ÉÓÃNTFSÎļþϵͳ¡£ÍøÕ¾µÄȨÏÞÉèÖðüº¬Á½²¿·Ö£ºÖ÷ÒªÊÇÍøÕ¾Îļþ¼ÐÓëÎļþµÄ·ÃÎÊȨÏÞ£¬Æä´ÎÊÇIISÖеÄinternetÄäÃûÓû§µÄ·ÃÎÊȨÏÞ¡£
Ò»¡¢ÍøÕ¾Îļþ¼ÐÓëÎļþ·ÃÎÊȨÏÞµÄÉèÖÃ
¼ÙÉèASPÍøÕ¾ÔÚÒÔÏÂÎļþ¼ÐÖУºweb ¡¢bbs£¬ÎÒÃdzÆÆäΪÍøÕ¾¸ùÎļþ¼Ð¡£
1¡¢ÏàͬµÄÉèÖÃ
£¨1£©±¾µØÓû§Ò»°ã¶¼Òª¶ÔÕ¾µãÄÚµÄÎļþ¼ÐºÍÎÄ ......