상품리스트 엑셀출력 채택완료
상품리스트 엑셀출력을 아래와 같이 알음알음 알아가며 소스를 적용시켜서 잘 사용하고 있는데요...
엑셀출력시 등록순(날짜)? 으로 출력이 되는거 같아요..
제조사가 날짜별로 중구난방인데 출력시 등록날짜와 상관없이 제조사별로 묶어서 출력할수는 없을까요?..
http://www.bettina-attack.de/jonny/view.php/projects/php_writeexcel/">http://www.bettina-attack.de/jonny/view.php/projects/php_writeexcel/ =================================================================================*/ include_once(G5_LIB_PATH.'/Excel/php_writeexcel/class.writeexcel_workbook.inc.php'); include_once(G5_LIB_PATH.'/Excel/php_writeexcel/class.writeexcel_worksheet.inc.php'); $fname = tempnam(G5_DATA_PATH, "tmp-productlist.xls"); $workbook = new writeexcel_workbook($fname); $worksheet = $workbook->addworksheet(); // Put Excel data $data = array('상품고유번호', '제조사', '판매가격', '상품명'); $data = array_map('iconv_euckr', $data); $col = 0; foreach($data as $cell) { $worksheet->write(0, $col++, $cell); } $save_it_id = ''; for($i=1; $row=sql_fetch_array($result); $i++) { $row = array_map('iconv_euckr', $row); $worksheet->write($i, 0, ' '.$row['it_id']); $worksheet->write($i, 1, ' '.$row['it_maker']); $worksheet->write($i, 2, ' '.$row['it_price']); $worksheet->write($i, 3, $row['it_name']); } $workbook->close(); header("Content-Type: application/x-msexcel; name=\"상품리스트-".date("ymd", time()).".xls\""); header("Content-Disposition: inline; filename=\"상품리스트-".date("ymd", time()).".xls\""); $fh=fopen($fname, "rb"); fpassthru($fh); unlink($fname); exit; ?>
답변 1개
답변을 작성하려면 로그인이 필요합니다.
로그인