六月婷婷综合激情-六月婷婷综合-六月婷婷在线观看-六月婷婷在线-亚洲黄色在线网站-亚洲黄色在线观看网站

明輝手游網中心:是一個免費提供流行視頻軟件教程、在線學習分享的學習平臺!

也談ASP中的RESPONSE屬性

[摘要]在隨意去逛的時候,看到《ASP中巧用Response屬性》這篇文章,想起以前看到的一篇國外相關的文章,不敢獨占,拿出來和大家分享。 調試是通過了,但有些用英文原話,還請大家多多包涵。 這里講的是用ASP頁面如何轉換成EXCEL表格的形式,大家一點還記得以前有大蝦說過用DLL的形式來解決...
    在隨意去逛的時候,看到《ASP中巧用Response屬性》這篇文章,想起以前看到的一篇國外相關的文章,不敢獨占,拿出來和大家分享。
    調試是通過了,但有些用英文原話,還請大家多多包涵。
    這里講的是用ASP頁面如何轉換成EXCEL表格的形式,大家一點還記得以前有大蝦說過用DLL的形式來解決,但這樣對于大數(shù)據(jù)量來說,實在是慢。如果用文中介紹的方法,將不占用服務器的資源,只是在客戶端打開。還有個好處是:在網頁中的表格顯示成什么樣子,在EXCEL中的表格就是什么樣子。好吧,再告訴一個令人激動的消息,除了表格數(shù)據(jù),在EXCEL中,象按鈕等都一概不顯示。這樣又解決了大家的網頁打印問題,簡直就是一舉多得。
    廢話少說,進入正題。
    為了創(chuàng)建一個動態(tài)的EXCEL報表,你首先要在一個ASP文件中寫:
    <%
    Response.ContentType = "application/vnd.ms-excel"
    %>
    (記住:這句話一定要寫在文章的開頭喲,不然的話,嘿嘿....)
這句話是告訴瀏覽器接下來的代碼是EXCEL格式的,然后瀏覽器會提示你SAVE OR OPEN 該文件,然后你就可以打開了或保存它了。
    看一個例子先:
<%
Response.ContentType = "application/vnd.ms-excel"
%>
<HTML>
<HEAD>
<link rel="stylesheet" href="STYLE.CSS">
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<table border="1" width="100%" bordercolorlight="#000080" bordercolordark="#0000FF" height="190">
  <tr>
    <td width="100%" colspan="12" height="30">
      <p align="center"><b>由ASP頁面轉換成EXCEL報表</b></td>
  </tr>
  <%for i=1 to 8%>
  <tr>
    <td width="8%" height="16" align="center"><%=1*i%></td>
    <td width="8%" height="16" align="center"><%=2*i%></td>
    <td width="8%" height="16" align="center"><%=3*i%></td>
    <td width="8%" height="16" align="center"><%=4*i%></td>
    <td width="8%" height="16" align="center"><%=5*i%></td>
    <td width="8%" height="16" align="center"><%=6*i%></td>
    <td width="8%" height="16" align="center"><%=7*i%></td>
    <td width="8%" height="16" align="center"><%=8*i%></td>
    <td width="9%" height="16" align="center"><%=9*i%></td>
    <td width="9%" height="16" align="center"><%=10*i%></td>
    <td width="9%" height="16" align="center"><%=11*i%></td>
    <td width="9%" height="16" align="center"><%=12*i%></td>
  </tr>
  <%next%>
  <tr>
   <td>=sum(a2:a9)</td>
    <td>=sum(b2:b9)</td>
    <td>=sum(c2:c9)</td>
    <td>=sum(d2:d9)</td>
    <td>=sum(e2:e9)</td>
    <td>=sum(f2:f9)</td>
    <td>=sum(g2:g9)</td>
    <td>=sum(h2:h9)</td>
    <td>=sum(i2:i9)</td>
    <td>=sum(j2:j9)</td>
    <td>=sum(k2:k9)</td>
    <td>=sum(l2:l9)</td>
    
  </tr>
</table>
<P align=center><input type=button value="test report" onclick="javascript:alert('hello , my friend,are you ready?')"></P>

</BODY>
</HTML>
把此代碼搞到你的機器上,看看效果如何,哈哈,你就偷著樂去吧
等等,還有個小問題:
  Microsoft has acknowledged a BUG in IE (3.02, 4.0, 4.01, 4.01sp1) which causes it to misinterpret Excel output, particularly when generated by ASP, ISAPI, or CGI. You can read more about it at http://support.microsoft.com/support/kb/articles/q185/9/78.asp. To summarize: When Internet Explorer connects to a Web server resource that dynamically generates Word, Excel, or other Active Documents, Internet Explorer may send two GET requests for the resource. The second GET usually does not have session state information, temporary cookies, or authentication information that may have already been specified for the client. This bug can affect any local server (EXE) Active Document application hosted inside the Internet Explorer frame window. It occurs most frequently with ISAPI, ASP, or CGI applications that adjust the HTTP "Content Type" header to identify the installed application.

我呢,也碰到一個問題:我把它放在我自己的機器上(WIN2000)的時候,它并不給我下載或打開,只有把它放在另一臺WEBSERVER上的時候才調試成功。
如果兄弟們有什么更好的招,別忘了告訴我呀。





主站蜘蛛池模板: 天天噜噜揉揉狠狠夜夜 | 天天操天天爱天天干 | 天天天天天天天操 | 午夜狠狠干| 日韩午夜在线视频不卡片 | 五月天婷婷丁香中文在线观看 | 亚洲va欧美va国产va天堂 | 四虎永久在线精品国产 | 一区二区久久 | 四虎影院久久 | 日韩字幕 | 欧美在线xxx | 亚洲欧美人妖另类激情综合区 | 亚洲国产欧美精品 | 我要看一级黄色毛片 | 亚洲视频色 | 日韩精品亚洲精品485页 | 伊人第一页 | 午夜性色福利影院 | 青青伊人久久 | 日韩在线操 | 日本黄网站高清色大全 | 欧美性猛交ⅹxxx乱大交免费 | 中文线码中文高清播放中 | 日本视频免费观看 | 在线亚洲一区 | 四虎库 | 欧美最猛性xxxxx(亚洲精品) | 亚欧日韩毛片在线看免费网站 | 日韩经典第一页 | 亚洲国产香蕉视频欧美 | 天天夜天天干 | 日本三级带日本三级带黄国产 | 亚洲国产影院 | 青娱乐极品在线 | 欧美线人一区二区三区 | 五月婷婷伊人 | 天天插天天色 | 亚欧aⅴ天堂在线 | 日韩伦理网站 | 天天躁夜夜躁狠狠躁2018a |