Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

169
Views
El código Sheet.js en el navegador genera un archivo .xlsx corrupto. ¿Qué pasa con mi código?
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.17.2/xlsx.min.js"> </script> <script src="https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/2.0.0/FileSaver.min.js"> </script> <script> var wb = XLSX.utils.book_new(); $('.special-table').each(function(i,item){ var table_id = $(this).attr('id') var sheet_name = table_id.replace('-table','') console.log(table_id); wb.SheetNames.push(sheet_name) var ws = XLSX.utils.table_to_sheet(document.getElementById(table_id)); wb.Sheets[sheet_name] = ws; }) var wbout = XLSX.write(wb, {bookType:'xlsx', bookSST:true, type: 'binary'}); function s2ab(s) { var buf = new ArrayBuffer(s.length); var view = new Uint8Array(buf); for (var i=0; i<s.length; i++) view[i] = s.charCodeAt(i) & 0xFF; return buf; } $("#download").click(function(){ saveAs(new Blob([s2ab(wbout)],{type:"application/octet-stream"}), 'ppe_report.xlsx'); }); </script>

Seguí la guía aquí: https://redstapler.co/sheetjs-tutorial-html-table-to-excel/

Como dice el título, esto está en el navegador. ¿Alguien puede ayudar? Se agradece cualquier ayuda o consejo, ahora mismo me estoy rascando la cabeza. Gracias por adelantado

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Necesitaba usar xlsx.full.min.js, no xlsx.min.js

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!