Mục tiêu ngày 14 🎯

Sau hôm nay bạn sẽ:

✔ Xuất dữ liệu Excel

✔ Xuất PDF hồ sơ nhân sự

✔ Tối ưu tốc độ Web App

✔ Hoàn thiện hệ thống HRM đầy đủ


1. Export dữ liệu ra Excel

Cách đơn giản nhất

Apps Script cho phép tải file Google Sheets dưới dạng Excel.

Tạo link export

functionexportExcel(){

constss=SpreadsheetApp.getActive()
consturl=ss.getUrl().replace(/edit$/,'')

returnurl+'export?format=xlsx'

}

Gọi từ HTML

<buttononclick="downloadExcel()">Export Excel</button>

<script>

functiondownloadExcel(){

google.script.run
.withSuccessHandler(function(url){

window.open(url)

})
.exportExcel()

}

</script>

2. Export PDF hồ sơ nhân sự

Tạo template hồ sơ

file:

profile.html