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

159
Visualizações
Styling issue on an excel sheet on nodejs with excelJS

im using excelJS library to manipulate excel file, Im trying to mark one row at a certain color and its filling almost the whole table, So i tried filling only one cell and it returns the same problem and coloring almost the whole sheet. Anyone knows if its a known library bug or is it a bug with my code ?

const wb = new ExcelJS.Workbook();

const fileName = 'DevExercise.xlsx';


wb.xlsx.readFile(fileName).then(() => {
    

    // Iterate over all sheets
    wb.eachSheet(function (worksheet, sheetId) {

        // Iterate over all rows that have values in a worksheet
        worksheet.eachRow(function (row, rowNumber) {

            worksheet.getCell('G' + rowNumber).value = sumRow(row.values[3], row.values[4], row.values[5], row.values[6])
            if (row.values[2] == "Rent"){
                worksheet.getCell('C1').fill = {
                    type: 'pattern',
                    pattern:'darkVertical',
                    fgColor:{argb:'ffff00'}
                  };
                console.log("C" + rowNumber);
            }
            
        })

        

     
    });

    wb.xlsx.writeFile("copy" + fileName)
    .then(function() {
        // done
    });

}).catch(err => {
    console.log(err.message);
}); ```

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