:::

18-1 12月份工作表

<?php
//關閉PHP錯誤報告
error_reporting(E_ALL);  

//引入 PHPExcel 物件庫
require_once 'excel/PHPExcel.php';   

//引入 PHPExcel_IOFactory 物件庫
require_once 'excel/PHPExcel/IOFactory.php';   

//實體化Excel
$objPHPExcel = new PHPExcel(); 

$objPHPExcel->setActiveSheetIndex(0);  //設定預設顯示的工作表
$objActSheet = $objPHPExcel->getActiveSheet(); //指定預設工作表為 $objActSheet
$objActSheet->setTitle("個人通訊錄");  //設定標題

for($i=1;$i<=12;$i++){
    $objPHPExcel->createSheet();
    $objPHPExcel->setActiveSheetIndex($i);
    $var_name="objActSheet{$i}";
    $$var_name = $objPHPExcel->getActiveSheet();
    $$var_name->setTitle("{$i}月份收支簿");
}
$objPHPExcel->setActiveSheetIndex(0);


//輸出
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename=檔名'.date("YmdHis"));
header('Cache-Control: max-age=0');

$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
$objWriter->save('php://output');
exit;

?>


:::

搜尋

QR Code 區塊

https%3A%2F%2Fmail.tad0616.cp27.secserverpros.com%2Fmodules%2Ftad_book3%2Fpage.php%3Ftbdsn%3D228%26tbsn%3D8

書籍目錄

展開 | 闔起

線上使用者

344人線上 (144人在瀏覽線上書籍)

會員: 0

訪客: 344

更多…