This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const xl = require("excel4node"); | |
const wb = new xl.Workbook(); | |
const ws = wb.addWorksheet("Background Color"); | |
const greenBgColumnsRows = wb.createStyle({ | |
font: { color: "black", size: 12 }, | |
fill: { | |
type: "pattern", | |
patternType: "solid", | |
bgColor: "#33FF35", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const xl = require("excel4node"); | |
const wb = new xl.Workbook(); | |
const ws = wb.addWorksheet("Sheet1"); | |
ws.cell(2, 5, 2, 11, true) | |
.string( | |
"There is a flower within my heart, Daisy, Daisy! Planted one day by a glancing dart, Planted by Daisy Bell! Whether she loves me or loves me not, Sometimes it's hard to tell; Yet I am longing to share the lot Of beautiful Daisy Bell!" | |
) | |
.style({ | |
alignment: { | |
wrapText: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function excelDataFiller(rowNumber) { | |
const startIndex = 2; | |
const j = rowNumber + 1; | |
const numDiff = getCountDiff(storage.allCountResults[rowNumber].csdbCount, storage.allCountResults[rowNumber].esCount); | |
const perDiff = (storage.allCountResults[rowNumber].csdbCount - storage.allCountResults[rowNumber].esCount) / storage.allCountResults[rowNumber].csdbCount; | |
/* Column parameters */ | |
ws.column(1).setWidth(30); | |
ws.column(2).setWidth(27); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const xl = require('excel4node') | |
const wb = new xl.Workbook() | |
const ws1 = wb.addWorksheet('sheet 1') | |
ws1.cell(1, 1).string('Sheet 1 - A1') | |
ws1.cell(5, 1).string('Sheet 1 - A5') | |
ws2 = wb.addWorksheet('sheet 2') | |
ws2.cell(1, 1).string('Sheet 2 - A1') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const xl = require('excel4node'); | |
const costsObj = { | |
'supplies': { | |
'paper': 100, | |
'toner': 50, | |
}, | |
'equipment': { | |
'laptops': 3500, | |
'accessories': 150 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Require library | |
const xl = require('excel4node'); | |
// Create a new instance of a Workbook class | |
const wb = new xl.Workbook(); | |
// Add Worksheets to the workbook | |
const ws = wb.addWorksheet('Background Color'); | |
// create a style with solid background color |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var xl = require('excel4node'); | |
var wb = new xl.Workbook(); | |
var ws = wb.addWorksheet('test'); | |
var indianCurrency = wb.createStyle({ | |
numberFormat: '[>=10000000]"RS "##\\,##\\,##\\,##0;[>=100000]"RS "\\ ##\\,##\\,##0;"RS "##,##0', | |
}); | |
ws.column(1).setWidth(15); | |
ws.cell(1,1).number(12.34).style(indianCurrency); // displays as "RS 12" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var xl = require('excel4node'); | |
var wb = new xl.Workbook(); | |
var ws = wb.addWorksheet('test'); | |
// Create a reusable style | |
var style = wb.createStyle({ | |
numberFormat: '#.00%; -#.00%; -' | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const xl = require('excel4node'); | |
// Create workbook and add worksheet | |
const wb = new xl.Workbook(); | |
const ws = wb.addWorksheet('Data', { | |
disableRowSpansOptimization: true, | |
}); | |
// Generate some fake data for testing | |
const data = []; |
NewerOlder