我寫了一個生產數據匯總的asp網頁,想轉換為excel格式打開或存盤,我用一下語句實現,可程序報錯,  
            <%    
  server.scripttimeout=72000  
  lexcel=request("pexcel")  
  if   lexcel="1"   then  
                  response.buffer=true  
  response.contenttype   ="application/vnd.ms-excel"  
  end   if%>  
  錯誤提示為  
  the   connection   used   this   web   site   are   expired.  
  or   you   are   not   sign-in   to   the   system.  
   
  其中參數lexcel在點擊聯結時賦值為"1"。  
 

参考文章:

  • 妥协的小黑!论IBM Z出现后的本本市场
  • 离开IBM的ThinkPad是怎样造出来的
  • Google任命周韶宁销售和业务开发总裁
  • 另类时尚音乐机 明基西门子E61降百元
  • 联想与IBM PCD历史
  • 购买ThinkPad必看 最全面的验机术
  • 只需七招 鉴别IBM本本电源适配器
  • Goolge的桌面系统 Google OS截图爆料
  • 性价比超群:358元购MOTO C119手机
  • IBM ThinkPad X系列全特色解析
  • 网友回答:
    发表者:net_lover

    <%@   language=vbscript   %>  
      <%  
      response.buffer   =   true  
      response.contenttype   =   "application/vnd.ms-excel"  
      %>  
      <table   border="1">  
            <tr>  
                  <th>项目   a</th>  
                  <th>项目   b</th>  
                  <th>合计</th>  
                  <th>项目   c</th>  
                  <th>项目   d</th>  
                  <th>合计</th>  
            </tr>  
            <tr>  
                  <td   height="30"><%=request.form("aa")%></td>  
                  <td>3</td>  
                  <td>5</td>  
                  <td>6</td>  
                  <td>7</td>  
                  <td><font   color="red">=sum(a2:e2)*100</font></td>  
            </tr>  
            <tr>  
                  <td>2</td>  
                  <td>1</td>  
                  <td   colspan="4"><font   color="red">=sum(a3:b3)+f2</font></td>  
            </tr>  
      </table>  
     

    发表者:inelm

    或者使用创建   excel-application   对象的方法在服务器端生成   excel   文件也可以。

    发表者:garycx

    实在不行的话,生成一个文本文件,  
       
      数据间用逗号分隔,后缀用   csv   ,  
       
      这种文件默认是用   excel   打开的!

    发表者:anqiant

    <%@language="vbscript"   codepage="936"%>  
      <%  
      path=trim(request.form("path"))  
      names=trim(request.form("name"))  
      files=path&names  
      if   path<>""   and   names<>""   then  
            set   fs   =   server.createobject("scripting.filesystemobject")  
            filename   =   files  
            if   fs.fileexists(filename)   then  
                    fs.deletefile(filename)  
            end   if  
            set   myfile   =   fs.createtextfile(filename,true)  
            set   fs=nothing  
              response.write(files&"保存成功!")  
      else  
      %>  
      <html>  
      <head>  
      <meta   http-equiv="content-type"   content="text/html;   charset=gb2312">  
      <title>无标题文档</title>  
      </head>  
       
      <body>  
      <form   action="index.asp"   method="post"   name="form1">  
          <p>路 径:    
              <input   name="path"   type="text"   id="path">  
          </p>  
          <p>文件名:    
              <input   name="name"   type="text"   id="name">  
          </p>  
          <p>  
              <input   type="submit"   name="submit"   value="提交">  
          </p>  
      </form>  
      </body>  
      </html>  
      <%  
      end   if  
      %>  
     

    .