• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
    • 軟件測試技術
    • 軟件測試博客
    • 軟件測試視頻
    • 開源軟件測試技術
    • 軟件測試論壇
    • 軟件測試沙龍
    • 軟件測試資料下載
    • 軟件測試雜志
    • 軟件測試人才招聘
      暫時沒有公告

    字號: | 推薦給好友 上一篇 | 下一篇

    生成Excel文件范例(1):服務端

    發布: 2007-7-14 19:53 | 作者: 佚名    | 來源: 網絡轉載     | 查看: 13次 | 進入軟件測試論壇討論

    領測軟件測試網 <?php
        ob_start();

    ?>
    <html xmlns:o="urn:schemas-microsoft-com:office:office"
    xmlns:x="urn:schemas-microsoft-com:office:excel"
    xmlns="http://www.w3.org/TR/REC-html40">

    <head>
    <meta http-equiv=Content-Type content="text/html; charset=gb2312">
    <meta name=ProgId content=Excel.Sheet>
    <meta name=Generator content="Microsoft Excel 10">
    <link rel=File-List href="Page.files/filelist.xml">
    <style id="Book1_10519_Styles">
    <!--table
        {mso-displayed-decimal-separator:"\.";
        mso-displayed-thousand-separator:"\,";}
    .font510519
        {color:windowtext;
        font-size:9.0pt;
        font-weight:400;
        font-style:normal;
        text-decoration:none;
        font-family:宋體;
        mso-generic-font-family:auto;
        mso-font-charset:134;}
    .xl1510519
        {padding-top:1px;
        padding-right:1px;
        padding-left:1px;
        mso-ignore:padding;
        color:windowtext;
        font-size:12.0pt;
        font-weight:400;
        font-style:normal;
        text-decoration:none;
        font-family:宋體;
        mso-generic-font-family:auto;
        mso-font-charset:134;
        mso-number-format:General;
        text-align:general;
        vertical-align:middle;
        mso-background-source:auto;
        mso-pattern:auto;
        white-space:nowrap;}
    .xl2210519
        {padding-top:1px;
        padding-right:1px;
        padding-left:1px;
        mso-ignore:padding;
        color:windowtext;
        font-size:12.0pt;
        font-weight:400;
        font-style:normal;
        text-decoration:none;
        font-family:宋體;
        mso-generic-font-family:auto;
        mso-font-charset:134;
        mso-number-format:General;
        text-align:general;
        vertical-align:middle;
        border:.5pt solid windowtext;
        background:silver;
        mso-pattern:auto none;
        white-space:nowrap;}
    .xl2310519
        {padding-top:1px;
        padding-right:1px;
        padding-left:1px;
        mso-ignore:padding;
        color:windowtext;
        font-size:12.0pt;
        font-weight:400;
        font-style:normal;
        text-decoration:none;
        font-family:宋體;
        mso-generic-font-family:auto;
        mso-font-charset:134;
        mso-number-format:General;
        text-align:general;
        vertical-align:middle;
        border:.5pt solid windowtext;
        mso-background-source:auto;
        mso-pattern:auto;
        white-space:nowrap;}
    ruby
        {ruby-align:left;}
    rt
        {color:windowtext;
        font-size:9.0pt;
        font-weight:400;
        font-style:normal;
        text-decoration:none;
        font-family:宋體;
        mso-generic-font-family:auto;
        mso-font-charset:134;
        mso-char-type:none;}
    -->
    </style>
    </head>

    <body>
    <!--[if !excel]>  <![endif]-->
    <!--下列信息由 Microsoft Excel 的“發布為 Web 頁”向導生成。-->
    <!--如果同一條目從 Excel 中重新發布,則所有位于 DIV 標記之間的信息均將被替換。-->
    <!----------------------------->
    <!--“從 EXCEL 發布 Web 頁”向導開始-->
    <!----------------------------->

    <div id="Book1_10519" align=center x:publishsource="Excel">
    <?php
        if(false==isset($_POST["data"]))
        {
            echo    "沒有要顯示的數據"    ;
            exit;
        }
    ?>
    <table x:str border=0 cellpadding=0 cellspacing=0 width=519 style='border-collapse:
    collapse;table-layout:fixed;width:389pt'>
    <col width=72 span=2 style='width:54pt'>
    <col width=163 style='mso-width-source:userset;mso-width-alt:5216;width:122pt'>
    <col width=87 style='mso-width-source:userset;mso-width-alt:2784;width:65pt'>
    <col width=125 style='mso-width-source:userset;mso-width-alt:4000;width:94pt'>
    <tr height=19 style='height:14.25pt'>
      <td height=19 class=xl1510519 width=72 style='height:14.25pt;width:54pt'></td>
      <td class=xl1510519 width=72 style='width:54pt'></td>
      <td class=xl1510519 width=163 style='width:122pt'></td>
      <td class=xl1510519 width=87 style='width:65pt'></td>
      <td class=xl1510519 width=125 style='width:94pt'></td>
    </tr>
    <tr height=19 style='height:14.25pt'>
      <td height=19 class=xl1510519 style='height:14.25pt'></td>
      <td class=xl2210519>名稱</td>
      <td class=xl2210519 style='border-left:none'>地址</td>
      <td class=xl2210519 style='border-left:none'>QQ號</td>
      <td class=xl2210519 style='border-left:none'>電子郵件</td>
    </tr>
    <?php

        foreach($_POST["data"] as $val)
        {
            extract($val)    ;
    ?>

    <tr height=19 style='height:14.25pt'>
      <td height=19 class=xl1510519 style='height:14.25pt'></td>
      <td class=xl2310519 style='border-top:none'><?php echo $username ; ?></td>
      <td class=xl2310519 style='border-top:none;border-left:none'><?php echo $add ; ?></td>
      <td class=xl2310519 style='border-top:none;border-left:none'><?php echo $qq ; ?> </td>
      <td class=xl2310519 style='border-top:none;border-left:none'><?php echo $email ; ?></td>
    </tr>
    <?php
        }
    ?>

    <![if supportMisalignedColumns]>
    <tr height=0 style='display:none'>
      <td width=72 style='width:54pt'></td>
      <td width=72 style='width:54pt'></td>
      <td width=163 style='width:122pt'></td>
      <td width=87 style='width:65pt'></td>
      <td width=125 style='width:94pt'></td>
    </tr>
    <![endif]>
    </table>

    </div>


    <!----------------------------->
    <!--“從 EXCEL 發布 Web 頁”向導結束-->
    <!----------------------------->
    </body>

    </html>
    <?php
        $outStr=ob_get_contents();
        ob_end_clean();
         
            header("Content-type: application/octet-stream");
            Header("Accept-Ranges: bytes");
            Header("Accept-Length: ".strlen($outStr));
            Header("Content-Disposition: attachment; filename=test.Xls");
            // 輸出文件內容          
            echo $outStr    ;
    ?> 

    延伸閱讀

    文章來源于領測軟件測試網 http://www.kjueaiud.com/


    關于領測軟件測試網 | 領測軟件測試網合作伙伴 | 廣告服務 | 投稿指南 | 聯系我們 | 網站地圖 | 友情鏈接
    版權所有(C) 2003-2010 TestAge(領測軟件測試網)|領測國際科技(北京)有限公司|軟件測試工程師培訓網 All Rights Reserved
    北京市海淀區中關村南大街9號北京理工科技大廈1402室 京ICP備2023014753號-2
    技術支持和業務聯系:info@testage.com.cn 電話:010-51297073

    軟件測試 | 領測國際ISTQBISTQB官網TMMiTMMi認證國際軟件測試工程師認證領測軟件測試網

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>