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

230
Visualizações
How do to upload and convert json file to excel file in using javasxript and html

I need to upload and convert JSON files like

[
    {
        "First Name": "Paul",
        "Last Name": "Craig",
        "Gender": "Male",
        "Age": 18,
        "Phone": "072-8074-38"
    },
    {
        "First Name": "Alan",
        "Last Name": "Richards",
        "Gender": "Male",
        "Age": 22,
        "Phone": "616-2480-27"
    }
]

to excel file. Before downloading the file user must be able to preview the file. This needs to be done using HTML and javascript

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You can show the user the JSON Data using a normal html table

then you can do it like this:

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.13.1/xlsx.full.min.js"></script> 
        <script>
            function ExportData()
            {
               filename='people.xlsx';
               data=[
               {
                  "First Name": "Paul",
                  "Last Name": "Craig",
                  "Gender": "Male",
                  "Age": 18,
                  "Phone": "072-8074-38"
               },
               {
                  "First Name": "Alan",
                  "Last Name": "Richards",
                  "Gender": "Male",
                  "Age": 22,
                  "Phone": "616-2480-27"
              }
              ]
                var ws = XLSX.utils.json_to_sheet(data);
                var wb = XLSX.utils.book_new();
                XLSX.utils.book_append_sheet(wb, ws, "People");
                XLSX.writeFile(wb,filename);
             }
        </script>

This will let you download the json data as an excel file!

Reference: Javascript JSON to Excel file download

about 4 years ago · Juan Pablo Isaza Relatório
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