PHPExcelでエクセルのデータを読み込んで別名のエクセルを作成しているのですがオートフィルタやリッチテキストのデータをコピー出来ません。
ネット等で調べたのですが実装出来るのか出来ないのかよく解りません。
実装する方法があればどうかご教授お願いします。
一応ソースを載せておきます。
<<output.php>> <?php require_once dirname(__FILE__) . '/PHPExcel/Classes/PHPExcel/IOFactory.php'; require_once dirname(__FILE__) . '/PHPExcel/Classes/PHPExcel.php'; //ブラウザへ出力をリダイレクト header('Content-Type: application/vnd.ms-excel'); header('Content-Disposition: attachment;filename="myfile.xls"'); header('Cache-Control: max-age=0'); //テンプレートの読み込み $objReader = PHPExcel_IOFactory::createReader("Excel5"); $xl = $objReader->load("hinagata.xls"); //シートの設定 $xl->setActiveSheetIndex(0); $sheet = $xl->getActiveSheet(); //セルの値を設定 $sheet->setCellValue('S3', date('Y')-1988);//西暦 $sheet->setCellValue('U3',date('m'));//月 $sheet->setCellValue('W3',date('d'));//日 $sheet->setCellValue('K12',"210");//日 //Excel5形式で保存 $writer = PHPExcel_IOFactory::createWriter($xl, 'Excel5'); $writer->save('php://output'); exit; ?>
あなたの回答
tips
プレビュー