📋 자료 생성
조건 입력
인 펀드의 아래 정보를 기준으로 작성하여라
출력 필드 선택 및 순서
선택된 열 순서
드래그로 순서 변경 · ×로 제거
'!cols'] = currentHeaders.map(k => { const lbl = getExcelLabel(k); const w = [...lbl].reduce((s, c) => s + (c.charCodeAt(0) > 127 ? 2 : 1), 0); return { wch: Math.max(w + 2, 12) }; }); const wb = XLSX.utils.book_new(); XLSX.utils.book_append_sheet(wb, ws, '자료'); const buf = XLSX.write(wb, { bookType: 'xlsx', type: 'array' }); const blob = new Blob([buf], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' }); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = 'SBV_자료_' + currentRefDate + '.xlsx'; document.body.appendChild(a); a.click(); document.body.removeChild(a); URL.revokeObjectURL(url); } catch(err) { alert('Excel 생성 중 오류: ' + err.message); console.error(err); } } // ══════════════════════════════════════════════ // Word 다운로드 // ══════════════════════════════════════════════ function dlWord() { if (!currentRows.length) { alert('결과가 없습니다.'); return; } try { const d = new Date(currentRefDate); const dStr = d.getFullYear() + '.' + String(d.getMonth()+1).padStart(2,'0') + '.' + String(d.getDate()).padStart(2,'0'); const headers = currentHeaders.map(getLabel); const tbl = '' + '' + headers.map(h => '').join('') + '' + currentRows.map(row => '' + currentHeaders.map(k => '' ).join('') + '' ).join('') + '
' + h + '
' + fmtCell(k, row[k]) + '
'; const html = "" + "" + "" + "

SBV 자료

" + "

기준일: " + dStr + "

" + tbl + ""; const blob = new Blob(['' + html], { type: 'application/vnd.ms-word;charset=utf-8' }); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = 'SBV_자료_' + currentRefDate + '.doc'; document.body.appendChild(a); a.click(); document.body.removeChild(a); URL.revokeObjectURL(url); } catch(err) { alert('Word 생성 중 오류: ' + err.message); console.error(err); } } init();