From fe748adc01d655375d972e54eb958092c9259f06 Mon Sep 17 00:00:00 2001 From: protobi Date: Tue, 8 Mar 2016 12:57:04 -0500 Subject: [PATCH 1/4] Copy README from beta --- README.md | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index d01742e..d664844 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,20 @@ -# xlsx +# xlsx-style Parser and writer for various spreadsheet formats. Pure-JS cleanroom implementation from official specifications and related documents. +# About this fork +--- +**NOTE:** [This project](https://github.com/SheetJS/js-xlsx/tree/beta) is a fork of the original (and awesome) [SheetJS/xlsx](https://github.com/SheetJS/js-xlsx) project. +It is extended to enable cell formats to be read from and written to .xlsx workbooks. +The intent is to provide a temporary means of using these features in practice, and ultimately to merge this into the primary project. +Report any issues to https://github.com/protobi/js-xlsx/issues. + +For those contributing to this fork: +* `master` is the main branch, which follows the original repo to enable a future pull request. +* `beta` branch is published to npm and bower to make this fork available for use. +--- + Supported read formats: - Excel 2007+ XML Formats (XLSX/XLSM) @@ -24,10 +36,10 @@ Source: ## Installation -With [npm](https://www.npmjs.org/package/xlsx): +With [npm](https://www.npmjs.org/package/xlsx-style): ```sh -npm install xlsx --save +npm install xlsx-style --save ``` In the browser: @@ -39,7 +51,7 @@ In the browser: With [bower](http://bower.io/search/?q=js-xlsx): ```sh -bower install js-xlsx +bower install js-xlsx-style#beta ``` CDNjs automatically pulls the latest version and makes all versions available at @@ -419,14 +431,21 @@ Special worksheet keys (accessible as `worksheet[key]`, each starting with `!`): will write all cells in the merge range if they exist, so be sure that only the first cell (upper-left) in the range is set. +The following properties are currently used when generating an XLSX file, but not yet parsed: + +- `ws['!rowBreaks']`: array of row break points, e.g. `[16,32]` +- `ws['!colBreaks']`: array of col break points, e.g. `[8,16]` - `ws['!pageSetup']`: `{scale: '100', orientation: 'portrait'||'landscape'} + + ### Workbook Object `workbook.SheetNames` is an ordered list of the sheets in the workbook `wb.Sheets[sheetname]` returns an object representing the worksheet. -`wb.Props` is an object storing the standard properties. The following properties are written but not parsed: +`wb.Props` is an object storing the standard properties. The following properties are currently used when +generating an XLSX file, but not yet parsed: - `title` - `subject` - `description` @@ -485,7 +504,7 @@ The exported `write` and `writeFile` functions accept an options argument: | cellDates | false | Store dates as type `d` (default is `n`) | | bookSST | false | Generate Shared String Table ** | | bookType | 'xlsx' | Type of Workbook ("xlsx" or "xlsm" or "xlsb") | -| showGridLines | true | Show gridlines on all pages | +| showGridLines | true | Show gridlines on all pages | | tabSelected | '1' | Initial tab selected | - `bookSST` is slower and more memory intensive, but has better compatibility @@ -496,6 +515,7 @@ The exported `write` and `writeFile` functions accept an options argument: - `cellDates` only applies to XLSX output and is not guaranteed to work with third-party readers. Excel itself does not usually write cells with type `d` so non-Excel tools may ignore the data or blow up in the presence of dates. +- showGridLines and tabSelected are currently used when generating an XLSX file but not yet parse. ## Cell Styles @@ -525,7 +545,7 @@ top-level attributes: `fill`, `font`, `numFmt`, `alignment`, and `border`. | | | `"0.00%;\\(0.00%\\);\\-;@"` // string specifying a custom format, escaping special characters | | | `"m/dd/yy"` // string a date format using Excel's format notation | alignment | vertical | `"bottom"||"center"||"top"` -| | horizontal | `"bottom"||"center"||"top"` +| | horizontal | `"left"||"center"||"right"` | | wrapText | `true || false` | | readingOrder | `2` // for right-to-left | | textRotation | Number from `0` to `180` or `255` (default is `0`) From 0e62411e834f094d6d5aa1f01a83e17d0ab2f3ad Mon Sep 17 00:00:00 2001 From: protobi Date: Tue, 8 Mar 2016 13:26:42 -0500 Subject: [PATCH 2/4] Update README.md --- README.md | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d664844..3359c8a 100644 --- a/README.md +++ b/README.md @@ -258,7 +258,20 @@ XLSX.writeFile(workbook, 'out.xlsx'); ```js /* bookType can be 'xlsx' or 'xlsm' or 'xlsb' */ -var wopts = { bookType:'xlsx', bookSST:false, type:'binary' }; +var wopts = { + bookType:'xlsx', + bookSST:false, + type:'binary', + showGridLines: false, + defaultCellStyle: { font: { name: "Verdana", sz: 11, color: "FF00FF88"}, fill: {fgColor: {rgb: "FFFFAA00"}}}, + Props: { + title: "Goldilocks", + description: "Girl discovers mysterious cottage in forest ", + creator:"Traditional folk tale", + keywords: "Bears; porridge; property rights; iterative optimization", + subject: "subject" + } + }; var wbout = XLSX.write(workbook,wopts); @@ -504,7 +517,7 @@ The exported `write` and `writeFile` functions accept an options argument: | cellDates | false | Store dates as type `d` (default is `n`) | | bookSST | false | Generate Shared String Table ** | | bookType | 'xlsx' | Type of Workbook ("xlsx" or "xlsm" or "xlsb") | -| showGridLines | true | Show gridlines on all pages | +| showGridLines | true | Show grid lines on all pages (note capital L) | | tabSelected | '1' | Initial tab selected | - `bookSST` is slower and more memory intensive, but has better compatibility From 050b74edbfee6386d8ad43c2af48be42ee36b35d Mon Sep 17 00:00:00 2001 From: protobi Date: Tue, 8 Mar 2016 13:27:03 -0500 Subject: [PATCH 3/4] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3359c8a..e4370c5 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,7 @@ Parser and writer for various spreadsheet formats. Pure-JS cleanroom implementation from official specifications and related documents. # About this fork ---- -**NOTE:** [This project](https://github.com/SheetJS/js-xlsx/tree/beta) is a fork of the original (and awesome) [SheetJS/xlsx](https://github.com/SheetJS/js-xlsx) project. +[This project](https://github.com/SheetJS/js-xlsx/tree/beta) is a fork of the original (and awesome) [SheetJS/xlsx](https://github.com/SheetJS/js-xlsx) project. It is extended to enable cell formats to be read from and written to .xlsx workbooks. The intent is to provide a temporary means of using these features in practice, and ultimately to merge this into the primary project. Report any issues to https://github.com/protobi/js-xlsx/issues. @@ -13,7 +12,8 @@ Report any issues to https://github.com/protobi/js-xlsx/issues. For those contributing to this fork: * `master` is the main branch, which follows the original repo to enable a future pull request. * `beta` branch is published to npm and bower to make this fork available for use. ---- + +# Supported formats Supported read formats: From 2ec18e96ba3528f8c471a19768f9ff74cc18659f Mon Sep 17 00:00:00 2001 From: protobi Date: Tue, 8 Mar 2016 13:27:38 -0500 Subject: [PATCH 4/4] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e4370c5..0a76408 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Parser and writer for various spreadsheet formats. Pure-JS cleanroom implementation from official specifications and related documents. -# About this fork +## About this fork [This project](https://github.com/SheetJS/js-xlsx/tree/beta) is a fork of the original (and awesome) [SheetJS/xlsx](https://github.com/SheetJS/js-xlsx) project. It is extended to enable cell formats to be read from and written to .xlsx workbooks. The intent is to provide a temporary means of using these features in practice, and ultimately to merge this into the primary project. @@ -13,7 +13,7 @@ For those contributing to this fork: * `master` is the main branch, which follows the original repo to enable a future pull request. * `beta` branch is published to npm and bower to make this fork available for use. -# Supported formats +## Supported formats Supported read formats: