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

198
Visualizações
How to save a second file if there are more than 65000 rows in excel when exporting - XLSX

I want to download all the information stored in my database (Firebase) into an Excel sheet through my API.

Right now I have +2000 rows of information and it works fine. I understand that now excel's limitations are beyond 65000 rows but just in case to avoid any inconvenience later on. How can I divide all my information into a second spreadsheet if I have more than 65000 chunks of info?

This is the library I'm using https://www.npmjs.com/package/xlsx

And here is my code:

downloadPlans() {
  var wb = XLSX.utils.book_new();
  wb.SheetNames.push("Plans");

  var ws_data = [
    [
      "name",
      "productType",
      "onCreated",
      "tags",
      "catalog",
      "state",
      "brand",
      "code",
      "sqf",
      "width",
      "depth",
      "category",
      "stories",
      "bedrooms",
      "fullBaths",
      "halfBaths",
      "garage",
      "garageLocation",
      "garageType",
      "garageBays",
      "bedroomLocation",
      "laundryLocation",
      "description",
      "region",
    ],
    ...this.planCategory.map((plan) => [
      plan.name,
      plan.productType,
      plan.onCreated,
      plan.tags.join(","),
      plan.catalog,
      plan.state,
      plan.brand,
      plan.code,
      plan.sqf,
      plan.width,
      plan.depth,
      plan.category,
      plan.stories,
      plan.bedrooms,
      plan.fullBaths,
      plan.halfBaths,
      plan.garage,
      plan.garageLocation,
      plan.garageType,
      plan.garageBays,
      plan.bedroomLocation,
      plan.laundryLocation,
      plan.description,
      plan.region,
    ]),
  ];

  var ws = XLSX.utils.aoa_to_sheet(ws_data);
  wb.Sheets["Plans"] = ws;

  var wbout = XLSX.write(wb, {
    bookType: "xlsx",
    type: "binary",
  });

  function s2ab(s: string) {
    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;
  }
  FileSaver.saveAs(
    new Blob([s2ab(wbout)], { type: "application/octet-stream" }),
    "Plans.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