엑셀 파일 저장시 시트 이름을 따로 넣고 싶습니다.
본문
게시판 자료를 엑셀파일로 저장할때 파일이름이랑 시트이름이 같습니다.
문제가 파일이름이 길다보니 시트이름이 짤려서 나옵니다.
그래서 시트이름을 Sheet1 로 나오게 할수있는 방법이 없을까요?
<?php
include_once("./_common.php");
$ti = str_replace("-","",G5_TIME_YMDHIS);
$ti = str_replace(":","",$ti);
$ti = str_replace(" ","_",$ti);
header( "Content-type: application/vnd.ms-excel" );
header( "Content-Disposition: attachment; filename=".$row['wr_subject']."_".$row['wr_4']."_".$row['wr_6']."_".$row['wr_10'].".xls" );
?>
<meta http-equiv="Content-Type" content="application/vnd.ms-excel;charset=UTF-8">
<table border="1">
<thead>
<tr>
<th>번호</th>
<th>비고</th>
</tr>
</thead>
<tbody>
<?php
echo "<tr>
<td>$count_num</td>
<td>$value</td>
</tr>";
?>
</tbody>
</table>
답변 2
해당 예제 참고해보세요~
https://stackoverrun.com/ko/q/2810618
$objWorksheet = $objPHPExcel->getSheetByName('Worksheet1');
답변을 작성하시기 전에 로그인 해주세요.