Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

203
Visualizações
SheetJS writes blank excel files in javascript

I'm trying to read an excel file and took datas which are useful for me then I pushed to an array and called this array when I am writing the xlsx file. Although I can see the datas of array in console but it writes blank xlsx file when I run the function.

 var tempExportList = [id,city,disctrict,region,geocode(loc)]
                exportlist.push(tempExportList);// I am pushing the arrays to the exportlist array in for loop

 exportExcel(exportlist);// I call the function

function exportExcel(exList){
        let wb = XLSX.utils.book_new();

        wb.Props = {
            Title: 'test',
            Subject: 'Test',
            Author: 'B',
            CreatedDate: new Date(),
        };

        let wsName = 'newSheet';
        var wsData = [exportlist];
        console.log(wsData);//I can see the output here it is not null
        let ws = XLSX.utils.aoa_to_sheet(wsData);

        XLSX.utils.book_append_sheet(wb, ws, wsName);

        XLSX.writeFile(wb, 'test.xlsx');

    }
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda