Feeds:
文章
留言

Archive for 十二月 8th, 2005

參考 Microsoft 文件所做的 PHP 範例

<?php
/*
 * 如何在串流 MIME 內容時格式化 Excel 活頁簿
 *
 * 設計者:Chui-Wen Chiu
 *
 * 測試環境:
 *  Windows 2000 Professional
 *  Internet Explorer 6.0
 *  Excel 2000
 *  PHP 4.x
 *
 * 參考資料
 * [1] http://support.microsoft.com/default.aspx?scid=kb;zh-tw;271572
 *
 */
 // 送出 Excel 的標頭
 header(‘Content-type: application/vnd.ms-excel’);
?>
<HTML xmlns:x="urn:schemas-microsoft-com:office:excel">
<HEAD>
<style>
  <!–table
  @page
     {mso-header-data:"&CMultiplication Table00ADate: &D00APage &P";
 mso-page-orientation:landscape;}
     br
     {mso-data-placement:same-cell;}
  –>
</style>
  <!–[if gte mso 9]><xml>
   <x:ExcelWorkbook>
    <x:ExcelWorksheets>
     <x:ExcelWorksheet>
      <x:Name>Create By Chui-Wen Chiu</x:Name>
      <x:WorksheetOptions>
       <x:Print>
        <x:ValidPrinterInfo/>
       </x:Print>
      </x:WorksheetOptions>
     </x:ExcelWorksheet>
    </x:ExcelWorksheets>
   </x:ExcelWorkbook>
  </xml><![endif]–>
</HEAD>
<BODY>
<TABLE>
<?php
   // Excel 格式內容
   $count_j = 9;
   $count_i = 9;
   for( $i = 1; $i <= $count_i; ++$i){
     echo "  <tr>n";
     for( $j = 1; $j <= $count_j; ++$j){
       if (($j == 1) || ($i == 1)){
   echo "    <td bgcolor=’#fff8dc’>";
       }else{
   echo "    <td bgcolor=’#b0c4de’>";
       }
    echo $i*$j, "</td>n";
     }
     echo "  </tr>n";
   }
?>
</BODY>
</HTML>


Read Full Post »

Outlook Express 錯誤碼

Read Full Post »

Read Full Post »