protobi / workbook Goto Github PK
View Code? Open in Web Editor NEWWrapper for js-xlsx providing convenient way to accumulate sheets, rows, styles
License: MIT License
Wrapper for js-xlsx providing convenient way to accumulate sheets, rows, styles
License: MIT License
Add in headers an attribute for width cells or auto width cell if text cell is bigger.
If it's methods were on the prototype overriding it would be super easy.
class MyWorkbook extends Workboot {}
Just a placeholder, since it was mentioned in #2
Would be nice to have an API like:
wb.createSheet('Abutters', options) // default styles and other options
.row(options) // default options for row, cells inherit these options unless overwritten
.cell(value, options)
.cell(value, options)
.row() // 1 empty row
.rowOffset(2) // 2 empty rows
.row(value, options) // merged
.cellOffset(5) // 5 empty cells
.cell(value)
.row(options)
.cells([1, 2, 3]) // 3 cells with values only, work well with default row options
.finalize();
Or something similar. This could make it open to things like currencyCell(value, format)
or other cell types.
I've managed to create xlsx files through node without any problems, however doing the same through the browser creates files that don't have any styling.
I used the code from example.html for my tests except I replaced calls to JSDateToExcelDate() with simple values as the JSDateToExcelDate() function wasn't included.
What's the API for the defaultCellStyle
attribute for writeFile
? Is that part of your js-xlsx fork or is that in the normal project. I can't find the details anywhere.
This is my solution that you can change in the library
On line 128 you should change the validation.
var cell = (data[R][C] && typeof data[R][C] == 'object' ? data[R][C] : { v: data[R][C] });
if (cell.v === null) continue;
instead of
var cell = (typeof data[R][C] == 'object' ? data[R][C] : { v: data[R][C] });
if (cell.v == null) continue;
because the error of a null cell value stop the execution process and does not generate the Excel file
Looks like the name workbook
is available.
does this support dropdowns read and write while creating a worksheet?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.