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

353
Views
Uncaught Error: Workbook is empty in xlsx and alasql excel file export

I'm using XLSX and alasql to export json object in to excel getting workbook is empty error, how to resolve

import * as alasql from 'alasql'
import * as XLSX from 'xlsx'

alasql.utils.isBrowserify = false
alasql.utils.global.XLSX = XLSX


const fileName = 'Ticket Details ' + props.ticketNumber
alasql('SELECT INTO XLSX("' + fileName + '.xlsx",?) FROM ?', [opts, finalData])
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

After debugging the code I got to know my finalData Array is empty, then I corrected the array value

Solution:

import * as alasql from 'alasql'
import * as XLSX from 'xlsx'

alasql.utils.isBrowserify = false
alasql.utils.global.XLSX = XLSX

const finalData = [
    {name:"John", city: "Seattle"},
    {name:"Mike", city: "Los Angeles"},
    {name:"Zach", city: "New York"}
]
const fileName = 'Ticket Details ' + props.ticketNumber
alasql('SELECT INTO XLSX("' + fileName + '.xlsx",?) FROM ?', [opts, finalData])
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!