UNPKG

99.1 kBMarkdownView Raw
1# ExcelJS
2
3[![Build Status](https://travis-ci.org/guyonroche/exceljs.svg?branch=master)](https://travis-ci.org/guyonroche/exceljs)
4
5Read, manipulate and write spreadsheet data and styles to XLSX and JSON.
6
7Reverse engineered from Excel spreadsheet files as a project.
8
9# Installation
10
11```shell
12npm install exceljs
13```
14
15# New Features!
16
17<ul>
18 <li>
19 Merged <a href="https://github.com/guyonroche/exceljs/pull/582">Update index.d.ts #582</a>.
20 Many thanks to <a href="https://github.com/hankolsen">hankolsen</a> for this contribution.
21 </li>
22 <li>
23 Merged <a href="https://github.com/guyonroche/exceljs/pull/584">Decode the _x<4 hex chars>_ escape notation in shared strings #584</a>.
24 Many thanks to <a href="https://github.com/papandreou">Andreas Lind</a> for this contribution.
25 </li>
26</ul>
27
28# Contributions
29
30Contributions are very welcome! It helps me know what features are desired or what bugs are causing the most pain.
31
32I have just one request; If you submit a pull request for a bugfix, please add a unit-test or integration-test (in the spec folder) that catches the problem.
33 Even a PR that just has a failing test is fine - I can analyse what the test is doing and fix the code from that.
34
35To be clear, all contributions added to this library will be included in the library's MIT licence.
36
37# Notice
38
39I have to admit I'm still really snowed under at the moment and will not be able to
40pursue active development of exceljs in the coming months.
41I will however keep an eye on the pull requests and endeavour to merge and release
42them as they come.
43
44# Backlog
45
46<ul>
47 <li>ESLint - slowly turn on (justifyable) rules which should, I hope, help make contributions easier.</li>
48 <li>Conditional Formatting.</li>
49 <li>There are still more print-settings to add; Fixed rows/cols, etc.</li>
50 <li>XLSX Streaming Reader.</li>
51 <li>Parsing CSV with Headers</li>
52</ul>
53
54# Contents
55
56<ul>
57 <li>
58 <a href="#interface">Interface</a>
59 <ul>
60 <li><a href="#create-a-workbook">Create a Workbook</a></li>
61 <li><a href="#set-workbook-properties">Set Workbook Properties</a></li>
62 <li><a href="#workbook-views">Workbook Views</a></li>
63 <li><a href="#add-a-worksheet">Add a Worksheet</a></li>
64 <li><a href="#remove-a-worksheet">Remove a Worksheet</a></li>
65 <li><a href="#access-worksheets">Access Worksheets</a></li>
66 <li><a href="#worksheet-state">Worksheet State</a></li>
67 <li><a href="#worksheet-properties">Worksheet Properties</a></li>
68 <li><a href="#page-setup">Page Setup</a></li>
69 <li>
70 <a href="#worksheet-views">Worksheet Views</a>
71 <ul>
72 <li><a href="#frozen-views">Frozen Views</a></li>
73 <li><a href="#split-views">Split Views</a></li>
74 </ul>
75 </li>
76 <li><a href="#auto-filters">Auto Filters</a></li>
77 <li><a href="#columns">Columns</a></li>
78 <li><a href="#rows">Rows</a></li>
79 <li><a href="#handling-individual-cells">Handling Individual Cells</a></li>
80 <li><a href="#merged-cells">Merged Cells</a></li>
81 <li><a href="#defined-names">Defined Names</a></li>
82 <li><a href="#data-validations">Data Validations</a></li>
83 <li><a href="#styles">Styles</a>
84 <ul>
85 <li><a href="#number-formats">Number Formats</a></li>
86 <li><a href="#fonts">Fonts</a></li>
87 <li><a href="#alignment">Alignment</a></li>
88 <li><a href="#borders">Borders</a></li>
89 <li><a href="#fills">Fills</a></li>
90 <li><a href="#rich-text">Rich Text</a></li>
91 </ul>
92 </li>
93 <li><a href="#outline-levels">Outline Levels</a></li>
94 <li><a href="#images">Images</a></li>
95 <li><a href="#file-io">File I/O</a>
96 <ul>
97 <li><a href="#xlsx">XLSX</a>
98 <ul>
99 <li><a href="#reading-xlsx">Reading XLSX</a></li>
100 <li><a href="#writing-xlsx">Writing XLSX</a></li>
101 </ul>
102 </li>
103 <li><a href="#csv">CSV</a>
104 <ul>
105 <li><a href="#reading-csv">Reading CSV</a></li>
106 <li><a href="#writing-csv">Writing CSV</a></li>
107 </ul>
108 </li>
109 <li><a href="#streaming-io">Streaming I/O</a>
110 <ul>
111 <li><a href="#reading-csv">Streaming XLSX</a></li>
112 </ul>
113 </li>
114 </ul>
115 </li>
116 </ul>
117 </li>
118 <li><a href="#browser">Browser</a></li>
119 <li>
120 <a href="#value-types">Value Types</a>
121 <ul>
122 <li><a href="#null-value">Null Value</a></li>
123 <li><a href="#merge-cell">Merge Cell</a></li>
124 <li><a href="#number-value">Number Value</a></li>
125 <li><a href="#string-value">String Value</a></li>
126 <li><a href="#date-value">Date Value</a></li>
127 <li><a href="#hyperlink-value">Hyperlink Value</a></li>
128 <li>
129 <a href="#formula-value">Formula Value</a>
130 <ul>
131 <li><a href="#shared-formula">Shared Formula</a></li>
132 <li><a href="#formula-type">Formula Type</a></li>
133 </ul>
134 </li>
135 <li><a href="#rich-text-value">Rich Text Value</a></li>
136 <li><a href="#boolean-value">Boolean Value</a></li>
137 <li><a href="#error-value">Error Value</a></li>
138 </ul>
139 </li>
140 <li><a href="#config">Config</a></li>
141 <li><a href="#known-issues">Known Issues</a></li>
142 <li><a href="#release-history">Release History</a></li>
143</ul>
144
145# Interface
146
147```javascript
148var Excel = require('exceljs');
149```
150
151## Create a Workbook
152
153```javascript
154var workbook = new Excel.Workbook();
155```
156
157## Set Workbook Properties
158
159```javascript
160workbook.creator = 'Me';
161workbook.lastModifiedBy = 'Her';
162workbook.created = new Date(1985, 8, 30);
163workbook.modified = new Date();
164workbook.lastPrinted = new Date(2016, 9, 27);
165```
166
167```javascript
168// Set workbook dates to 1904 date system
169workbook.properties.date1904 = true;
170```
171
172## Workbook Views
173
174The Workbook views controls how many separate windows Excel will open when viewing the workbook.
175
176```javascript
177workbook.views = [
178 {
179 x: 0, y: 0, width: 10000, height: 20000,
180 firstSheet: 0, activeTab: 1, visibility: 'visible'
181 }
182]
183```
184
185## Add a Worksheet
186
187```javascript
188var sheet = workbook.addWorksheet('My Sheet');
189```
190
191Use the second parameter of the addWorksheet function to specify options for the worksheet.
192
193For Example:
194
195```javascript
196// create a sheet with red tab colour
197var sheet = workbook.addWorksheet('My Sheet', {properties:{tabColor:{argb:'FFC0000'}}});
198
199// create a sheet where the grid lines are hidden
200var sheet = workbook.addWorksheet('My Sheet', {properties: {showGridLines: false}});
201
202// create a sheet with the first row and column frozen
203var sheet = workbook.addWorksheet('My Sheet', {views:[{xSplit: 1, ySplit:1}]});
204```
205
206## Remove a Worksheet
207
208Use the worksheet `id` to remove the sheet from workbook.
209
210For Example:
211
212```javascript
213// Create a worksheet
214var sheet = workbook.addWorksheet('My Sheet');
215
216// Remove the worksheet using worksheet id
217workbook.removeWorksheet(sheet.id)
218```
219
220## Access Worksheets
221```javascript
222// Iterate over all sheets
223// Note: workbook.worksheets.forEach will still work but this is better
224workbook.eachSheet(function(worksheet, sheetId) {
225 // ...
226});
227
228// fetch sheet by name
229var worksheet = workbook.getWorksheet('My Sheet');
230
231// fetch sheet by id
232var worksheet = workbook.getWorksheet(1);
233```
234
235## Worksheet State
236
237// make worksheet visible
238worksheet.state = 'show';
239
240// make worksheet hidden
241worksheet.state = 'hidden';
242
243## Worksheet Properties
244
245Worksheets support a property bucket to allow control over some features of the worksheet.
246
247```javascript
248// create new sheet with properties
249var worksheet = workbook.addWorksheet('sheet', {properties:{tabColor:{argb:'FF00FF00'}}});
250
251// create a new sheet writer with properties
252var worksheetWriter = workbookWriter.addSheet('sheet', {properties:{outlineLevelCol:1}});
253
254// adjust properties afterwards (not supported by worksheet-writer)
255worksheet.properties.outlineLevelCol = 2;
256worksheet.properties.defaultRowHeight = 15;
257```
258
259**Supported Properties**
260
261| Name | Default | Description |
262| ---------------- | ---------- | ----------- |
263| tabColor | undefined | Color of the tabs |
264| outlineLevelCol | 0 | The worksheet column outline level |
265| outlineLevelRow | 0 | The worksheet row outline level |
266| defaultRowHeight | 15 | Default row height |
267| dyDescent | 55 | TBD |
268
269### Worksheet Metrics
270
271Some new metrics have been added to Worksheet...
272
273| Name | Description |
274| ----------------- | ----------- |
275| rowCount | The total row size of the document. Equal to the row number of the last row that has values. |
276| actualRowCount | A count of the number of rows that have values. If a mid-document row is empty, it will not be included in the count. |
277| columnCount | The total column size of the document. Equal to the maximum cell count from all of the rows |
278| actualColumnCount | A count of the number of columns that have values. |
279
280
281## Page Setup
282
283All properties that can affect the printing of a sheet are held in a pageSetup object on the sheet.
284
285```javascript
286// create new sheet with pageSetup settings for A4 - landscape
287var worksheet = workbook.addWorksheet('sheet', {
288 pageSetup:{paperSize: 9, orientation:'landscape'}
289});
290
291// create a new sheet writer with pageSetup settings for fit-to-page
292var worksheetWriter = workbookWriter.addSheet('sheet', {
293 pageSetup:{fitToPage: true, fitToHeight: 5, fitToWidth: 7}
294});
295
296// adjust pageSetup settings afterwards
297worksheet.pageSetup.margins = {
298 left: 0.7, right: 0.7,
299 top: 0.75, bottom: 0.75,
300 header: 0.3, footer: 0.3
301};
302
303// Set Print Area for a sheet
304worksheet.pageSetup.printArea = 'A1:G20';
305
306// Repeat specific rows on every printed page
307worksheet.pageSetup.printTitlesRow = '1:3';
308
309```
310
311**Supported pageSetup settings**
312
313| Name | Default | Description |
314| --------------------- | ------------- | ----------- |
315| margins | | Whitespace on the borders of the page. Units are inches. |
316| orientation | 'portrait' | Orientation of the page - i.e. taller (portrait) or wider (landscape) |
317| horizontalDpi | 4294967295 | Horizontal Dots per Inch. Default value is -1 |
318| verticalDpi | 4294967295 | Vertical Dots per Inch. Default value is -1 |
319| fitToPage | | Whether to use fitToWidth and fitToHeight or scale settings. Default is based on presence of these settings in the pageSetup object - if both are present, scale wins (i.e. default will be false) |
320| pageOrder | 'downThenOver'| Which order to print the pages - one of ['downThenOver', 'overThenDown'] |
321| blackAndWhite | false | Print without colour |
322| draft | false | Print with less quality (and ink) |
323| cellComments | 'None' | Where to place comments - one of ['atEnd', 'asDisplayed', 'None'] |
324| errors | 'displayed' | Where to show errors - one of ['dash', 'blank', 'NA', 'displayed'] |
325| scale | 100 | Percentage value to increase or reduce the size of the print. Active when fitToPage is false |
326| fitToWidth | 1 | How many pages wide the sheet should print on to. Active when fitToPage is true |
327| fitToHeight | 1 | How many pages high the sheet should print on to. Active when fitToPage is true |
328| paperSize | | What paper size to use (see below) |
329| showRowColHeaders | false | Whether to show the row numbers and column letters |
330| showGridLines | false | Whether to show grid lines |
331| firstPageNumber | | Which number to use for the first page |
332| horizontalCentered | false | Whether to center the sheet data horizontally |
333| verticalCentered | false | Whether to center the sheet data vertically |
334
335**Example Paper Sizes**
336
337| Name | Value |
338| ----------------------------- | --------- |
339| Letter | undefined |
340| Legal | 5 |
341| Executive | 7 |
342| A4 | 9 |
343| A5 | 11 |
344| B5 (JIS) | 13 |
345| Envelope #10 | 20 |
346| Envelope DL | 27 |
347| Envelope C5 | 28 |
348| Envelope B5 | 34 |
349| Envelope Monarch | 37 |
350| Double Japan Postcard Rotated | 82 |
351| 16K 197x273 mm | 119 |
352
353## Worksheet Views
354
355Worksheets now support a list of views, that control how Excel presents the sheet:
356
357* frozen - where a number of rows and columns to the top and left are frozen in place. Only the bottom left section will scroll
358* split - where the view is split into 4 sections, each semi-independently scrollable.
359
360Each view also supports various properties:
361
362| Name | Default | Description |
363| ----------------- | --------- | ----------- |
364| state | 'normal' | Controls the view state - one of normal, frozen or split |
365| rightToLeft | false | Sets the worksheet view's orientation to right-to-left |
366| activeCell | undefined | The currently selected cell |
367| showRuler | true | Shows or hides the ruler in Page Layout |
368| showRowColHeaders | true | Shows or hides the row and column headers (e.g. A1, B1 at the top and 1,2,3 on the left |
369| showGridLines | true | Shows or hides the gridlines (shown for cells where borders have not been defined) |
370| zoomScale | 100 | Percentage zoom to use for the view |
371| zoomScaleNormal | 100 | Normal zoom for the view |
372| style | undefined | Presentation style - one of pageBreakPreview or pageLayout. Note pageLayout is not compatable with frozen views |
373
374### Frozen Views
375
376Frozen views support the following extra properties:
377
378| Name | Default | Description |
379| ----------------- | --------- | ----------- |
380| xSplit | 0 | How many columns to freeze. To freeze rows only, set this to 0 or undefined |
381| ySplit | 0 | How many rows to freeze. To freeze columns only, set this to 0 or undefined |
382| topLeftCell | special | Which cell will be top-left in the bottom-right pane. Note: cannot be a frozen cell. Defaults to first unfrozen cell |
383
384```javascript
385worksheet.views = [
386 {state: 'frozen', xSplit: 2, ySplit: 3, topLeftCell: 'G10', activeCell: 'A1'}
387];
388```
389
390### Split Views
391
392Split views support the following extra properties:
393
394| Name | Default | Description |
395| ----------------- | --------- | ----------- |
396| xSplit | 0 | How many points from the left to place the splitter. To split vertically, set this to 0 or undefined |
397| ySplit | 0 | How many points from the top to place the splitter. To split horizontally, set this to 0 or undefined |
398| topLeftCell | undefined | Which cell will be top-left in the bottom-right pane. |
399| activePane | undefined | Which pane will be active - one of topLeft, topRight, bottomLeft and bottomRight |
400
401```javascript
402worksheet.views = [
403 {state: 'split', xSplit: 2000, ySplit: 3000, topLeftCell: 'G10', activeCell: 'A1'}
404];
405```
406
407## Auto filters
408
409It is possible to apply an auto filter to your worksheet.
410
411```javascript
412worksheet.autoFilter = 'A1:C1';
413```
414
415While the range string is the standard form of the autoFilter, the worksheet will also support the
416following values:
417
418```javascript
419// Set an auto filter from A1 to C1
420worksheet.autoFilter = {
421 from: 'A1',
422 to: 'C1',
423}
424
425// Set an auto filter from the cell in row 3 and column 1
426// to the cell in row 5 and column 12
427worksheet.autoFilter = {
428 from: {
429 row: 3,
430 column: 1
431 },
432 to: {
433 row: 5,
434 column: 12
435 }
436}
437
438// Set an auto filter from D3 to the
439// cell in row 7 and column 5
440worksheet.autoFilter = {
441 from: 'D3',
442 to: {
443 row: 7,
444 column: 5
445 }
446}
447```
448
449## Columns
450
451```javascript
452// Add column headers and define column keys and widths
453// Note: these column structures are a workbook-building convenience only,
454// apart from the column width, they will not be fully persisted.
455worksheet.columns = [
456 { header: 'Id', key: 'id', width: 10 },
457 { header: 'Name', key: 'name', width: 32 },
458 { header: 'D.O.B.', key: 'DOB', width: 10, outlineLevel: 1 }
459];
460
461// Access an individual columns by key, letter and 1-based column number
462var idCol = worksheet.getColumn('id');
463var nameCol = worksheet.getColumn('B');
464var dobCol = worksheet.getColumn(3);
465
466// set column properties
467
468// Note: will overwrite cell value C1
469dobCol.header = 'Date of Birth';
470
471// Note: this will overwrite cell values C1:C2
472dobCol.header = ['Date of Birth', 'A.K.A. D.O.B.'];
473
474// from this point on, this column will be indexed by 'dob' and not 'DOB'
475dobCol.key = 'dob';
476
477dobCol.width = 15;
478
479// Hide the column if you'd like
480dobCol.hidden = true;
481
482// set an outline level for columns
483worksheet.getColumn(4).outlineLevel = 0;
484worksheet.getColumn(5).outlineLevel = 1;
485
486// columns support a readonly field to indicate the collapsed state based on outlineLevel
487expect(worksheet.getColumn(4).collapsed).to.equal(false);
488expect(worksheet.getColumn(5).collapsed).to.equal(true);
489
490// iterate over all current cells in this column
491dobCol.eachCell(function(cell, rowNumber) {
492 // ...
493});
494
495// iterate over all current cells in this column including empty cells
496dobCol.eachCell({ includeEmpty: true }, function(cell, rowNumber) {
497 // ...
498});
499
500// add a column of new values
501worksheet.getColumn(6).values = [1,2,3,4,5];
502
503// add a sparse column of values
504worksheet.getColumn(7).values = [,,2,3,,5,,7,,,,11];
505
506// cut one or more columns (columns to the right are shifted left)
507// If column properties have been definde, they will be cut or moved accordingly
508// Known Issue: If a splice causes any merged cells to move, the results may be unpredictable
509worksheet.spliceColumns(3,2);
510
511// remove one column and insert two more.
512// Note: columns 4 and above will be shifted right by 1 column.
513// Also: If the worksheet has more rows than values in the colulmn inserts,
514// the rows will still be shifted as if the values existed
515var newCol3Values = [1,2,3,4,5];
516var newCol4Values = ['one', 'two', 'three', 'four', 'five'];
517worksheet.spliceColumns(3, 1, newCol3Values, newCol4Values);
518
519```
520
521## Rows
522
523```javascript
524// Add a couple of Rows by key-value, after the last current row, using the column keys
525worksheet.addRow({id: 1, name: 'John Doe', dob: new Date(1970,1,1)});
526worksheet.addRow({id: 2, name: 'Jane Doe', dob: new Date(1965,1,7)});
527
528// Add a row by contiguous Array (assign to columns A, B & C)
529worksheet.addRow([3, 'Sam', new Date()]);
530
531// Add a row by sparse Array (assign to columns A, E & I)
532var rowValues = [];
533rowValues[1] = 4;
534rowValues[5] = 'Kyle';
535rowValues[9] = new Date();
536worksheet.addRow(rowValues);
537
538// Add an array of rows
539var rows = [
540 [5,'Bob',new Date()], // row by array
541 {id:6, name: 'Barbara', dob: new Date()}
542];
543worksheet.addRows(rows);
544
545// Get a row object. If it doesn't already exist, a new empty one will be returned
546var row = worksheet.getRow(5);
547
548// Get the last editable row in a worksheet (or undefined if there are none)
549var row = worksheet.lastRow;
550
551// Set a specific row height
552row.height = 42.5;
553
554// make row hidden
555row.hidden = true;
556
557// set an outline level for rows
558worksheet.getRow(4).outlineLevel = 0;
559worksheet.getRow(5).outlineLevel = 1;
560
561// rows support a readonly field to indicate the collapsed state based on outlineLevel
562expect(worksheet.getRow(4).collapsed).to.equal(false);
563expect(worksheet.getRow(5).collapsed).to.equal(true);
564
565
566row.getCell(1).value = 5; // A5's value set to 5
567row.getCell('name').value = 'Zeb'; // B5's value set to 'Zeb' - assuming column 2 is still keyed by name
568row.getCell('C').value = new Date(); // C5's value set to now
569
570// Get a row as a sparse array
571// Note: interface change: worksheet.getRow(4) ==> worksheet.getRow(4).values
572row = worksheet.getRow(4).values;
573expect(row[5]).toEqual('Kyle');
574
575// assign row values by contiguous array (where array element 0 has a value)
576row.values = [1,2,3];
577expect(row.getCell(1).value).toEqual(1);
578expect(row.getCell(2).value).toEqual(2);
579expect(row.getCell(3).value).toEqual(3);
580
581// assign row values by sparse array (where array element 0 is undefined)
582var values = []
583values[5] = 7;
584values[10] = 'Hello, World!';
585row.values = values;
586expect(row.getCell(1).value).toBeNull();
587expect(row.getCell(5).value).toEqual(7);
588expect(row.getCell(10).value).toEqual('Hello, World!');
589
590// assign row values by object, using column keys
591row.values = {
592 id: 13,
593 name: 'Thing 1',
594 dob: new Date()
595};
596
597// Insert a page break below the row
598row.addPageBreak();
599
600// Iterate over all rows that have values in a worksheet
601worksheet.eachRow(function(row, rowNumber) {
602 console.log('Row ' + rowNumber + ' = ' + JSON.stringify(row.values));
603});
604
605// Iterate over all rows (including empty rows) in a worksheet
606worksheet.eachRow({ includeEmpty: true }, function(row, rowNumber) {
607 console.log('Row ' + rowNumber + ' = ' + JSON.stringify(row.values));
608});
609
610// Iterate over all non-null cells in a row
611row.eachCell(function(cell, colNumber) {
612 console.log('Cell ' + colNumber + ' = ' + cell.value);
613});
614
615// Iterate over all cells in a row (including empty cells)
616row.eachCell({ includeEmpty: true }, function(cell, colNumber) {
617 console.log('Cell ' + colNumber + ' = ' + cell.value);
618});
619
620// Cut one or more rows (rows below are shifted up)
621// Known Issue: If a splice causes any merged cells to move, the results may be unpredictable
622worksheet.spliceRows(4,3);
623
624// remove one row and insert two more.
625// Note: rows 4 and below will be shifted down by 1 row.
626var newRow3Values = [1,2,3,4,5];
627var newRow4Values = ['one', 'two', 'three', 'four', 'five'];
628worksheet.spliceRows(3, 1, newRow3Values, newRow4Values);
629
630// Cut one or more cells (cells to the right are shifted left)
631// Note: this operation will not affect other rows
632row.splice(3,2);
633
634// remove one cell and insert two more (cells to the right of the cut cell will be shifted right)
635row.splice(4,1,'new value 1', 'new value 2');
636
637// Commit a completed row to stream
638row.commit();
639
640// row metrics
641var rowSize = row.cellCount;
642var numValues = row.actualCellCount;
643```
644
645## Handling Individual Cells
646
647```javascript
648// Modify/Add individual cell
649worksheet.getCell('C3').value = new Date(1968, 5, 1);
650
651// query a cell's type
652expect(worksheet.getCell('C3').type).toEqual(Excel.ValueType.Date);
653```
654
655## Merged Cells
656
657```javascript
658// merge a range of cells
659worksheet.mergeCells('A4:B5');
660
661// ... merged cells are linked
662worksheet.getCell('B5').value = 'Hello, World!';
663expect(worksheet.getCell('B5').value).toBe(worksheet.getCell('A4').value);
664expect(worksheet.getCell('B5').master).toBe(worksheet.getCell('A4'));
665
666// ... merged cells share the same style object
667expect(worksheet.getCell('B5').style).toBe(worksheet.getCell('A4').style);
668worksheet.getCell('B5').style.font = myFonts.arial;
669expect(worksheet.getCell('A4').style.font).toBe(myFonts.arial);
670
671// unmerging the cells breaks the style links
672worksheet.unMergeCells('A4');
673expect(worksheet.getCell('B5').style).not.toBe(worksheet.getCell('A4').style);
674expect(worksheet.getCell('B5').style.font).not.toBe(myFonts.arial);
675
676// merge by top-left, bottom-right
677worksheet.mergeCells('G10', 'H11');
678worksheet.mergeCells(10,11,12,13); // top,left,bottom,right
679```
680
681## Defined Names
682
683Individual cells (or multiple groups of cells) can have names assigned to them.
684 The names can be used in formulas and data validation (and probably more).
685
686```javascript
687// assign (or get) a name for a cell (will overwrite any other names that cell had)
688worksheet.getCell('A1').name = 'PI';
689expect(worksheet.getCell('A1').name).to.equal('PI');
690
691// assign (or get) an array of names for a cell (cells can have more than one name)
692worksheet.getCell('A1').names = ['thing1', 'thing2'];
693expect(worksheet.getCell('A1').names).to.have.members(['thing1', 'thing2']);
694
695// remove a name from a cell
696worksheet.getCell('A1').removeName('thing1');
697expect(worksheet.getCell('A1').names).to.have.members(['thing2']);
698```
699
700## Data Validations
701
702Cells can define what values are valid or not and provide prompting to the user to help guide them.
703
704Validation types can be one of the following:
705
706| Type | Description |
707| ---------- | ----------- |
708| list | Define a discrete set of valid values. Excel will offer these in a dropdown for easy entry |
709| whole | The value must be a whole number |
710| decimal | The value must be a decimal number |
711| textLength | The value may be text but the length is controlled |
712| custom | A custom formula controls the valid values |
713
714For types other than list or custom, the following operators affect the validation:
715
716| Operator | Description |
717| -------------------- | ----------- |
718| between | Values must lie between formula results |
719| notBetween | Values must not lie between formula results |
720| equal | Value must equal formula result |
721| notEqual | Value must not equal formula result |
722| greaterThan | Value must be greater than formula result |
723| lessThan | Value must be less than formula result |
724| greaterThanOrEqual | Value must be greater than or equal to formula result |
725| lessThanOrEqual | Value must be less than or equal to formula result |
726
727```javascript
728// Specify list of valid values (One, Two, Three, Four).
729// Excel will provide a dropdown with these values.
730worksheet.getCell('A1').dataValidation = {
731 type: 'list',
732 allowBlank: true,
733 formulae: ['"One,Two,Three,Four"']
734};
735
736// Specify list of valid values from a range.
737// Excel will provide a dropdown with these values.
738 worksheet.getCell('A1').dataValidation = {
739 type: 'list',
740 allowBlank: true,
741 formulae: ['$D$5:$F$5']
742};
743
744// Specify Cell must be a whole number that is not 5.
745// Show the user an appropriate error message if they get it wrong
746worksheet.getCell('A1').dataValidation = {
747 type: 'whole',
748 operator: 'notEqual',
749 showErrorMessage: true,
750 formulae: [5],
751 errorStyle: 'error',
752 errorTitle: 'Five',
753 error: 'The value must not be Five'
754};
755
756// Specify Cell must be a decomal number between 1.5 and 7.
757// Add 'tooltip' to help guid the user
758worksheet.getCell('A1').dataValidation = {
759 type: 'decimal',
760 operator: 'between',
761 allowBlank: true,
762 showInputMessage: true,
763 formulae: [1.5, 7],
764 promptTitle: 'Decimal',
765 prompt: 'The value must between 1.5 and 7'
766};
767
768// Specify Cell must be have a text length less than 15
769worksheet.getCell('A1').dataValidation = {
770 type: 'textLength',
771 operator: 'lessThan',
772 showErrorMessage: true,
773 allowBlank: true,
774 formulae: [15]
775};
776
777// Specify Cell must be have be a date before 1st Jan 2016
778worksheet.getCell('A1').dataValidation = {
779 type: 'date',
780 operator: 'lessThan',
781 showErrorMessage: true,
782 allowBlank: true,
783 formulae: [new Date(2016,0,1)]
784};
785```
786
787## Styles
788
789Cells, Rows and Columns each support a rich set of styles and formats that affect how the cells are displayed.
790
791Styles are set by assigning the following properties:
792
793* <a href="#number-formats">numFmt</a>
794* <a href="#fonts">font</a>
795* <a href="#alignment">alignment</a>
796* <a href="#borders">border</a>
797* <a href="#fills">fill</a>
798
799```javascript
800// assign a style to a cell
801ws.getCell('A1').numFmt = '0.00%';
802
803// Apply styles to worksheet columns
804ws.columns = [
805 { header: 'Id', key: 'id', width: 10 },
806 { header: 'Name', key: 'name', width: 32, style: { font: { name: 'Arial Black' } } },
807 { header: 'D.O.B.', key: 'DOB', width: 10, style: { numFmt: 'dd/mm/yyyy' } }
808];
809
810// Set Column 3 to Currency Format
811ws.getColumn(3).numFmt = '"£"#,##0.00;[Red]\-"£"#,##0.00';
812
813// Set Row 2 to Comic Sans.
814ws.getRow(2).font = { name: 'Comic Sans MS', family: 4, size: 16, underline: 'double', bold: true };
815```
816
817When a style is applied to a row or column, it will be applied to all currently existing cells in that row or column.
818 Also, any new cell that is created will inherit its initial styles from the row and column it belongs to.
819
820If a cell's row and column both define a specific style (e.g. font), the cell will use the row style over the column style.
821 However if the row and column define different styles (e.g. column.numFmt and row.font), the cell will inherit the font from the row and the numFmt from the column.
822
823Caveat: All the above properties (with the exception of numFmt, which is a string), are JS object structures.
824 If the same style object is assigned to more than one spreadsheet entity, then each entity will share the same style object.
825 If the style object is later modified before the spreadsheet is serialized, then all entities referencing that style object will be modified too.
826 This behaviour is intended to prioritize performance by reducing the number of JS objects created.
827 If you want the style objects to be independent, you will need to clone them before assigning them.
828 Also, by default, when a document is read from file (or stream) if spreadsheet entities share similar styles, then they will reference the same style object too.
829
830### Number Formats
831
832```javascript
833// display value as '1 3/5'
834ws.getCell('A1').value = 1.6;
835ws.getCell('A1').numFmt = '# ?/?';
836
837// display value as '1.60%'
838ws.getCell('B1').value = 0.016;
839ws.getCell('B1').numFmt = '0.00%';
840```
841
842### Fonts
843
844```javascript
845
846// for the wannabe graphic designers out there
847ws.getCell('A1').font = {
848 name: 'Comic Sans MS',
849 family: 4,
850 size: 16,
851 underline: true,
852 bold: true
853};
854
855// for the graduate graphic designers...
856ws.getCell('A2').font = {
857 name: 'Arial Black',
858 color: { argb: 'FF00FF00' },
859 family: 2,
860 size: 14,
861 italic: true
862};
863
864// note: the cell will store a reference to the font object assigned.
865// If the font object is changed afterwards, the cell font will change also...
866var font = { name: 'Arial', size: 12 };
867ws.getCell('A3').font = font;
868font.size = 20; // Cell A3 now has font size 20!
869
870// Cells that share similar fonts may reference the same font object after
871// the workbook is read from file or stream
872```
873
874| Font Property | Description | Example Value(s) |
875| ------------- | ----------------- | ---------------- |
876| name | Font name. | 'Arial', 'Calibri', etc. |
877| family | Font family for fallback. An integer value. | 1 - Serif, 2 - Sans Serif, 3 - Mono, Others - unknown |
878| scheme | Font scheme. | 'minor', 'major', 'none' |
879| charset | Font charset. An integer value. | 1, 2, etc. |
880| color | Colour description, an object containing an ARGB value. | { argb: 'FFFF0000'} |
881| bold | Font **weight** | true, false |
882| italic | Font *slope* | true, false |
883| underline | Font <u>underline</u> style | true, false, 'none', 'single', 'double', 'singleAccounting', 'doubleAccounting' |
884| strike | Font <strike>strikethrough</strike> | true, false |
885| outline | Font outline | true, false |
886
887### Alignment
888
889```javascript
890// set cell alignment to top-left, middle-center, bottom-right
891ws.getCell('A1').alignment = { vertical: 'top', horizontal: 'left' };
892ws.getCell('B1').alignment = { vertical: 'middle', horizontal: 'center' };
893ws.getCell('C1').alignment = { vertical: 'bottom', horizontal: 'right' };
894
895// set cell to wrap-text
896ws.getCell('D1').alignment = { wrapText: true };
897
898// set cell indent to 1
899ws.getCell('E1').alignment = { indent: 1 };
900
901// set cell text rotation to 30deg upwards, 45deg downwards and vertical text
902ws.getCell('F1').alignment = { textRotation: 30 };
903ws.getCell('G1').alignment = { textRotation: -45 };
904ws.getCell('H1').alignment = { textRotation: 'vertical' };
905```
906
907**Valid Alignment Property Values**
908
909| horizontal | vertical | wrapText | indent | readingOrder | textRotation |
910| ---------------- | ----------- | -------- | ------- | ------------ | ------------ |
911| left | top | true | integer | rtl | 0 to 90 |
912| center | middle | false | | ltr | -1 to -90 |
913| right | bottom | | | | vertical |
914| fill | distributed | | | | |
915| justify | justify | | | | |
916| centerContinuous | | | | | |
917| distributed | | | | | |
918
919
920### Borders
921
922```javascript
923// set single thin border around A1
924ws.getCell('A1').border = {
925 top: {style:'thin'},
926 left: {style:'thin'},
927 bottom: {style:'thin'},
928 right: {style:'thin'}
929};
930
931// set double thin green border around A3
932ws.getCell('A3').border = {
933 top: {style:'double', color: {argb:'FF00FF00'}},
934 left: {style:'double', color: {argb:'FF00FF00'}},
935 bottom: {style:'double', color: {argb:'FF00FF00'}},
936 right: {style:'double', color: {argb:'FF00FF00'}}
937};
938
939// set thick red cross in A5
940ws.getCell('A5').border = {
941 diagonal: {up: true, down: true, style:'thick', color: {argb:'FFFF0000'}}
942};
943```
944
945**Valid Border Styles**
946
947* thin
948* dotted
949* dashDot
950* hair
951* dashDotDot
952* slantDashDot
953* mediumDashed
954* mediumDashDotDot
955* mediumDashDot
956* medium
957* double
958* thick
959
960### Fills
961
962```javascript
963// fill A1 with red darkVertical stripes
964ws.getCell('A1').fill = {
965 type: 'pattern',
966 pattern:'darkVertical',
967 fgColor:{argb:'FFFF0000'}
968};
969
970// fill A2 with yellow dark trellis and blue behind
971ws.getCell('A2').fill = {
972 type: 'pattern',
973 pattern:'darkTrellis',
974 fgColor:{argb:'FFFFFF00'},
975 bgColor:{argb:'FF0000FF'}
976};
977
978// fill A3 with blue-white-blue gradient from left to right
979ws.getCell('A3').fill = {
980 type: 'gradient',
981 gradient: 'angle',
982 degree: 0,
983 stops: [
984 {position:0, color:{argb:'FF0000FF'}},
985 {position:0.5, color:{argb:'FFFFFFFF'}},
986 {position:1, color:{argb:'FF0000FF'}}
987 ]
988};
989
990
991// fill A4 with red-green gradient from center
992ws.getCell('A2').fill = {
993 type: 'gradient',
994 gradient: 'path',
995 center:{left:0.5,top:0.5},
996 stops: [
997 {position:0, color:{argb:'FFFF0000'}},
998 {position:1, color:{argb:'FF00FF00'}}
999 ]
1000};
1001```
1002
1003#### Pattern Fills
1004
1005| Property | Required | Description |
1006| -------- | -------- | ----------- |
1007| type | Y | Value: 'pattern'<br/>Specifies this fill uses patterns |
1008| pattern | Y | Specifies type of pattern (see <a href="#valid-pattern-types">Valid Pattern Types</a> below) |
1009| fgColor | N | Specifies the pattern foreground color. Default is black. |
1010| bgColor | N | Specifies the pattern background color. Default is white. |
1011
1012**Valid Pattern Types**
1013
1014* none
1015* solid
1016* darkVertical
1017* darkGray
1018* mediumGray
1019* lightGray
1020* gray125
1021* gray0625
1022* darkHorizontal
1023* darkVertical
1024* darkDown
1025* darkUp
1026* darkGrid
1027* darkTrellis
1028* lightHorizontal
1029* lightVertical
1030* lightDown
1031* lightUp
1032* lightGrid
1033* lightTrellis
1034* lightGrid
1035
1036#### Gradient Fills
1037
1038| Property | Required | Description |
1039| -------- | -------- | ----------- |
1040| type | Y | Value: 'gradient'<br/>Specifies this fill uses gradients |
1041| gradient | Y | Specifies gradient type. One of ['angle', 'path'] |
1042| degree | angle | For 'angle' gradient, specifies the direction of the gradient. 0 is from the left to the right. Values from 1 - 359 rotates the direction clockwise |
1043| center | path | For 'path' gradient. Specifies the relative coordinates for the start of the path. 'left' and 'top' values range from 0 to 1 |
1044| stops | Y | Specifies the gradient colour sequence. Is an array of objects containing position and color starting with position 0 and ending with position 1. Intermediary positions may be used to specify other colours on the path. |
1045
1046**Caveats**
1047
1048Using the interface above it may be possible to create gradient fill effects not possible using the XLSX editor program.
1049For example, Excel only supports angle gradients of 0, 45, 90 and 135.
1050Similarly the sequence of stops may also be limited by the UI with positions [0,1] or [0,0.5,1] as the only options.
1051Take care with this fill to be sure it is supported by the target XLSX viewers.
1052
1053#### Rich Text
1054
1055Individual cells now support rich text or in-cell formatting.
1056 Rich text values can control the font properties of any number of sub-strings within the text value.
1057 See <a href="font">Fonts</a> for a complete list of details on what font properties are supported.
1058
1059```javascript
1060
1061ws.getCell('A1').value = {
1062 'richText': [
1063 {'font': {'size': 12,'color': {'theme': 0},'name': 'Calibri','family': 2,'scheme': 'minor'},'text': 'This is '},
1064 {'font': {'italic': true,'size': 12,'color': {'theme': 0},'name': 'Calibri','scheme': 'minor'},'text': 'a'},
1065 {'font': {'size': 12,'color': {'theme': 1},'name': 'Calibri','family': 2,'scheme': 'minor'},'text': ' '},
1066 {'font': {'size': 12,'color': {'argb': 'FFFF6600'},'name': 'Calibri','scheme': 'minor'},'text': 'colorful'},
1067 {'font': {'size': 12,'color': {'theme': 1},'name': 'Calibri','family': 2,'scheme': 'minor'},'text': ' text '},
1068 {'font': {'size': 12,'color': {'argb': 'FFCCFFCC'},'name': 'Calibri','scheme': 'minor'},'text': 'with'},
1069 {'font': {'size': 12,'color': {'theme': 1},'name': 'Calibri','family': 2,'scheme': 'minor'},'text': ' in-cell '},
1070 {'font': {'bold': true,'size': 12,'color': {'theme': 1},'name': 'Calibri','family': 2,'scheme': 'minor'},'text': 'format'}
1071 ]
1072};
1073
1074expect(ws.getCell('A1').text).to.equal('This is a colorful text with in-cell format');
1075expect(ws.getCell('A1').type).to.equal(Excel.ValueType.RichText);
1076
1077```
1078
1079## Outline Levels
1080
1081Excel supports outlining; where rows or columns can be expanded or collapsed depending on what level of detail the user wishes to view.
1082
1083Outline levels can be defined in column setup:
1084```javascript
1085worksheet.columns = [
1086 { header: 'Id', key: 'id', width: 10 },
1087 { header: 'Name', key: 'name', width: 32 },
1088 { header: 'D.O.B.', key: 'DOB', width: 10, outlineLevel: 1 }
1089];
1090```
1091
1092Or directly on the row or column
1093```javascript
1094worksheet.getColumn(3).outlineLevel = 1;
1095worksheet.getRow(3).outlineLevel = 1;
1096```
1097
1098The sheet outline levels can be set on the worksheet
1099```javascript
1100// set column outline level
1101worksheet.properties.outlineLevelCol = 1;
1102
1103// set row outline level
1104worksheet.properties.outlineLevelRow = 1;
1105```
1106
1107Note: adjusting outline levels on rows or columns or the outline levels on the worksheet will incur a side effect of also modifying the collapsed property of all rows or columns affected by the property change. E.g.:
1108```javascript
1109worksheet.properties.outlineLevelCol = 1;
1110
1111worksheet.getColumn(3).outlineLevel = 1;
1112expect(worksheet.getColumn(3).collapsed).to.be.true;
1113
1114worksheet.properties.outlineLevelCol = 2;
1115expect(worksheet.getColumn(3).collapsed).to.be.false;
1116```
1117
1118The outline properties can be set on the worksheet
1119
1120```javascript
1121worksheet.properties.outlineProperties = {
1122 summaryBelow: false,
1123 summaryRight: false,
1124};
1125```
1126
1127## Images
1128
1129Adding images to a worksheet is a two-step process.
1130First, the image is added to the workbook via the addImage() function which will also return an imageId value.
1131Then, using the imageId, the image can be added to the worksheet either as a tiled background or covering a cell range.
1132
1133Note: As of this version, adjusting or transforming the image is not supported.
1134
1135### Add Image to Workbook
1136
1137The Workbook.addImage function supports adding images by filename or by Buffer.
1138Note that in both cases, the extension must be specified.
1139Valid extension values include 'jpeg', 'png', 'gif'.
1140
1141```javascript
1142// add image to workbook by filename
1143var imageId1 = workbook.addImage({
1144 filename: 'path/to/image.jpg',
1145 extension: 'jpeg',
1146});
1147
1148// add image to workbook by buffer
1149var imageId2 = workbook.addImage({
1150 buffer: fs.readFileSync('path/to.image.png'),
1151 extension: 'png',
1152});
1153
1154// add image to workbook by base64
1155var myBase64Image = "data:image/png;base64,iVBORw0KG...";
1156var imageId2 = workbook.addImage({
1157 base64: myBase64Image,
1158 extension: 'png',
1159});
1160```
1161
1162### Add image background to worksheet
1163
1164Using the image id from Workbook.addImage, the background to a worksheet can be set using the addBackgroundImage function
1165
1166```javascript
1167// set background
1168worksheet.addBackgroundImage(imageId1);
1169```
1170
1171### Add image over a range
1172
1173Using the image id from Workbook.addImage, an image can be embedded within the worksheet to cover a range.
1174The coordinates calculated from the range will cover from the top-left of the first cell to the bottom right of the second.
1175
1176```javascript
1177// insert an image over B2:D6
1178worksheet.addImage(imageId2, 'B2:D6');
1179```
1180
1181Using a structure instead of a range string, it is possible to partially cover cells.
1182
1183Note that the coordinate system used for this is zero based, so the top-left of A1 will be { col: 0, row: 0 }.
1184Fractions of cells can be specified by using floating point numbers, e.g. the midpoint of A1 is { col: 0.5, row: 0.5 }.
1185
1186```javascript
1187// insert an image over part of B2:D6
1188worksheet.addImage(imageId2, {
1189 tl: { col: 1.5, row: 1.5 },
1190 br: { col: 3.5, row: 5.5 }
1191});
1192```
1193
1194The cell range can also have the eproperty 'editAs' which will control how the image is anchored to the cell(s)
1195It can have one of the following values:
1196
1197| Value | Description |
1198| --------- | ----------- |
1199| undefined | This is the default. It specifies the image will be moved and sized with cells |
1200| oneCell | Image will be moved with cells but not sized |
1201| absolute | Image will not be moved or sized with cells |
1202
1203```javascript
1204ws.addImage(imageId, {
1205 tl: { col: 0.1125, row: 0.4 },
1206 br: { col: 2.101046875, row: 3.4 },
1207 editAs: 'oneCell'
1208});
1209```
1210
1211## File I/O
1212
1213### XLSX
1214
1215#### Reading XLSX
1216
1217```javascript
1218// read from a file
1219var workbook = new Excel.Workbook();
1220workbook.xlsx.readFile(filename)
1221 .then(function() {
1222 // use workbook
1223 });
1224
1225// pipe from stream
1226var workbook = new Excel.Workbook();
1227stream.pipe(workbook.xlsx.createInputStream());
1228```
1229
1230#### Writing XLSX
1231
1232```javascript
1233// write to a file
1234var workbook = createAndFillWorkbook();
1235workbook.xlsx.writeFile(filename)
1236 .then(function() {
1237 // done
1238 });
1239
1240// write to a stream
1241workbook.xlsx.write(stream)
1242 .then(function() {
1243 // done
1244 });
1245```
1246
1247### CSV
1248
1249#### Reading CSV
1250
1251```javascript
1252// read from a file
1253var workbook = new Excel.Workbook();
1254workbook.csv.readFile(filename)
1255 .then(function(worksheet) {
1256 // use workbook or worksheet
1257 });
1258
1259// read from a stream
1260var workbook = new Excel.Workbook();
1261workbook.csv.read(stream)
1262 .then(function(worksheet) {
1263 // use workbook or worksheet
1264 });
1265
1266// pipe from stream
1267var workbook = new Excel.Workbook();
1268stream.pipe(workbook.csv.createInputStream());
1269
1270// read from a file with European Dates
1271var workbook = new Excel.Workbook();
1272var options = {
1273 dateFormats: ['DD/MM/YYYY']
1274};
1275workbook.csv.readFile(filename, options)
1276 .then(function(worksheet) {
1277 // use workbook or worksheet
1278 });
1279
1280// read from a file with custom value parsing
1281var workbook = new Excel.Workbook();
1282var options = {
1283 map: function(value, index) {
1284 switch(index) {
1285 case 0:
1286 // column 1 is string
1287 return value;
1288 case 1:
1289 // column 2 is a date
1290 return new Date(value);
1291 case 2:
1292 // column 3 is JSON of a formula value
1293 return JSON.parse(value);
1294 default:
1295 // the rest are numbers
1296 return parseFloat(value);
1297 }
1298 }
1299};
1300workbook.csv.readFile(filename, options)
1301 .then(function(worksheet) {
1302 // use workbook or worksheet
1303 });
1304```
1305
1306The CSV parser uses [fast-csv](https://www.npmjs.com/package/fast-csv) to read the CSV file.
1307 The options passed into the read functions above is also passed to fast-csv for parsing of the csv data.
1308 Please refer to the fast-csv README.md for details.
1309
1310Dates are parsed using the npm module [moment](https://www.npmjs.com/package/moment).
1311 If no dateFormats are supplied, the following are used:
1312
1313* moment.ISO_8601
1314* 'MM-DD-YYYY'
1315* 'YYYY-MM-DD'
1316
1317#### Writing CSV
1318
1319```javascript
1320
1321// write to a file
1322var workbook = createAndFillWorkbook();
1323workbook.csv.writeFile(filename)
1324 .then(function() {
1325 // done
1326 });
1327
1328// write to a stream
1329// Be careful that you need to provide sheetName or
1330// sheetId for correct import to csv.
1331workbook.csv.write(stream, { sheetName: 'Page name' })
1332 .then(function() {
1333 // done
1334 });
1335
1336// read from a file with European Date-Times
1337var workbook = new Excel.Workbook();
1338var options = {
1339 dateFormat: 'DD/MM/YYYY HH:mm:ss',
1340 dateUTC: true, // use utc when rendering dates
1341};
1342workbook.csv.readFile(filename, options)
1343 .then(function(worksheet) {
1344 // use workbook or worksheet
1345 });
1346
1347
1348// read from a file with custom value formatting
1349var workbook = new Excel.Workbook();
1350var options = {
1351 map: function(value, index) {
1352 switch(index) {
1353 case 0:
1354 // column 1 is string
1355 return value;
1356 case 1:
1357 // column 2 is a date
1358 return moment(value).format('YYYY-MM-DD');
1359 case 2:
1360 // column 3 is a formula, write just the result
1361 return value.result;
1362 default:
1363 // the rest are numbers
1364 return value;
1365 }
1366 }
1367};
1368workbook.csv.readFile(filename, options)
1369 .then(function(worksheet) {
1370 // use workbook or worksheet
1371 });
1372```
1373
1374The CSV parser uses [fast-csv](https://www.npmjs.com/package/fast-csv) to write the CSV file.
1375 The options passed into the write functions above is also passed to fast-csv for writing the csv data.
1376 Please refer to the fast-csv README.md for details.
1377
1378Dates are formatted using the npm module [moment](https://www.npmjs.com/package/moment).
1379 If no dateFormat is supplied, moment.ISO_8601 is used.
1380 When writing a CSV you can supply the boolean dateUTC as true to have ExcelJS parse the date without automatically
1381 converting the timezone using `moment.utc()`.
1382
1383### Streaming I/O
1384
1385The File I/O documented above requires that an entire workbook is built up in memory before the file can be written.
1386 While convenient, it can limit the size of the document due to the amount of memory required.
1387
1388A streaming writer (or reader) processes the workbook or worksheet data as it is generated,
1389 converting it into file form as it goes. Typically this is much more efficient on memory as the final
1390 memory footprint and even intermediate memory footprints are much more compact than with the document version,
1391 especially when you consider that the row and cell objects are disposed once they are committed.
1392
1393The interface to the streaming workbook and worksheet is almost the same as the document versions with a few minor practical differences:
1394
1395* Once a worksheet is added to a workbook, it cannot be removed.
1396* Once a row is committed, it is no longer accessible since it will have been dropped from the worksheet.
1397* unMergeCells() is not supported.
1398
1399Note that it is possible to build the entire workbook without committing any rows.
1400 When the workbook is committed, all added worksheets (including all uncommitted rows) will be automatically committed.
1401 However in this case, little will have been gained over the Document version.
1402
1403#### Streaming XLSX
1404
1405##### Streaming XLSX Writer
1406
1407The streaming XLSX writer is available in the ExcelJS.stream.xlsx namespace.
1408
1409The constructor takes an optional options object with the following fields:
1410
1411| Field | Description |
1412| ---------------- | ----------- |
1413| stream | Specifies a writable stream to write the XLSX workbook to. |
1414| filename | If stream not specified, this field specifies the path to a file to write the XLSX workbook to. |
1415| useSharedStrings | Specifies whether to use shared strings in the workbook. Default is false |
1416| useStyles | Specifies whether to add style information to the workbook. Styles can add some performance overhead. Default is false |
1417
1418If neither stream nor filename is specified in the options, the workbook writer will create a StreamBuf object
1419 that will store the contents of the XLSX workbook in memory.
1420 This StreamBuf object, which can be accessed via the property workbook.stream, can be used to either
1421 access the bytes directly by stream.read() or to pipe the contents to another stream.
1422
1423```javascript
1424// construct a streaming XLSX workbook writer with styles and shared strings
1425var options = {
1426 filename: './streamed-workbook.xlsx',
1427 useStyles: true,
1428 useSharedStrings: true
1429};
1430var workbook = new Excel.stream.xlsx.WorkbookWriter(options);
1431```
1432
1433In general, the interface to the streaming XLSX writer is the same as the Document workbook (and worksheets)
1434 described above, in fact the row, cell and style objects are the same.
1435
1436However there are some differences...
1437
1438**Construction**
1439
1440As seen above, the WorkbookWriter will typically require the output stream or file to be specified in the constructor.
1441
1442**Committing Data**
1443
1444When a worksheet row is ready, it should be committed so that the row object and contents can be freed.
1445 Typically this would be done as each row is added...
1446
1447```javascript
1448worksheet.addRow({
1449 id: i,
1450 name: theName,
1451 etc: someOtherDetail
1452}).commit();
1453```
1454
1455The reason the WorksheetWriter does not commit rows as they are added is to allow cells to be merged across rows:
1456```javascript
1457worksheet.mergeCells('A1:B2');
1458worksheet.getCell('A1').value = 'I am merged';
1459worksheet.getCell('C1').value = 'I am not';
1460worksheet.getCell('C2').value = 'Neither am I';
1461worksheet.getRow(2).commit(); // now rows 1 and two are committed.
1462```
1463
1464As each worksheet is completed, it must also be committed:
1465
1466```javascript
1467// Finished adding data. Commit the worksheet
1468worksheet.commit();
1469```
1470
1471To complete the XLSX document, the workbook must be committed. If any worksheet in a workbook are uncommitted,
1472 they will be committed automatically as part of the workbook commit.
1473
1474```javascript
1475// Finished the workbook.
1476workbook.commit()
1477 .then(function() {
1478 // the stream has been written
1479 });
1480```
1481
1482# Browser
1483
1484A portion of this library has been isolated and tested for use within a browser environment.
1485
1486Due to the streaming nature of the workbook reader and workbook writer, these have not been included.
1487Only the document based workbook may be used (see <a href="#create-a-workbook">Create a Worbook</a> for details).
1488
1489For example code using ExcelJS in the browser take a look at the <a href="https://github.com/guyonroche/exceljs/tree/master/spec/browser">spec/browser</a> folder in the github repo.
1490
1491## Prebundled
1492
1493The following files are pre-bundled and included inside the dist folder.
1494
1495* exceljs.js
1496* exceljs.min.js
1497
1498# Value Types
1499
1500The following value types are supported.
1501
1502## Null Value
1503
1504Enum: Excel.ValueType.Null
1505
1506A null value indicates an absence of value and will typically not be stored when written to file (except for merged cells).
1507 It can be used to remove the value from a cell.
1508
1509E.g.
1510
1511```javascript
1512worksheet.getCell('A1').value = null;
1513```
1514
1515## Merge Cell
1516
1517Enum: Excel.ValueType.Merge
1518
1519A merge cell is one that has its value bound to another 'master' cell.
1520 Assigning to a merge cell will cause the master's cell to be modified.
1521
1522## Number Value
1523
1524Enum: Excel.ValueType.Number
1525
1526A numeric value.
1527
1528E.g.
1529
1530```javascript
1531worksheet.getCell('A1').value = 5;
1532worksheet.getCell('A2').value = 3.14159;
1533```
1534
1535## String Value
1536
1537Enum: Excel.ValueType.String
1538
1539A simple text string.
1540
1541E.g.
1542
1543```javascript
1544worksheet.getCell('A1').value = 'Hello, World!';
1545```
1546
1547## Date Value
1548
1549Enum: Excel.ValueType.Date
1550
1551A date value, represented by the JavaScript Date type.
1552
1553E.g.
1554
1555```javascript
1556worksheet.getCell('A1').value = new Date(2017, 2, 15);
1557```
1558
1559## Hyperlink Value
1560
1561Enum: Excel.ValueType.Hyperlink
1562
1563A URL with both text and link value.
1564
1565E.g.
1566```javascript
1567// link to web
1568worksheet.getCell('A1').value = { text: 'www.mylink.com', hyperlink: 'http://www.mylink.com' };
1569
1570// internal link
1571worksheet.getCell('A1').value = { text: 'Sheet2', hyperlink: '#\\"Sheet2\\"!A1' };
1572```
1573
1574## Formula Value
1575
1576Enum: Excel.ValueType.Formula
1577
1578An Excel formula for calculating values on the fly.
1579 Note that while the cell type will be Formula, the cell may have an effectiveType value that will
1580 be derived from the result value.
1581
1582Note that ExcelJS cannot process the formula to generate a result, it must be supplied.
1583
1584E.g.
1585
1586```javascript
1587worksheet.getCell('A3').value = { formula: 'A1+A2', result: 7 };
1588```
1589
1590Cells also support convenience getters to access the formula and result:
1591
1592```javascript
1593worksheet.getCell('A3').formula === 'A1+A2';
1594worksheet.getCell('A3').result === 7;
1595```
1596
1597### Shared Formula
1598
1599Shared formulae enhance the compression of the xlsx document by increasing the repetition
1600of text within the worksheet xml.
1601
1602A shared formula can be assigned to a cell using a new value form:
1603
1604```javascript
1605worksheet.getCell('B3').value = { sharedFormula: 'A3', result: 10 };
1606```
1607
1608This specifies that the cell B3 is a formula that will be derived from the formula in
1609A3 and its result is 10.
1610
1611The formula convenience getter will translate the formula in A3 to what it should be in B3:
1612
1613```javascript
1614worksheet.getCell('B3').formula === 'B1+B2';
1615```
1616
1617### Formula Type
1618
1619To distinguish between real and translated formula cells, use the formulaType getter:
1620
1621```javascript
1622worksheet.getCell('A3').formulaType === Enums.FormulaType.Master;
1623worksheet.getCell('B3').formulaType === Enums.FormulaType.Shared;
1624```
1625
1626Formula type has the following values:
1627
1628| Name | Value |
1629| -------------------------- | ------- |
1630| Enums.FormulaType.None | 0 |
1631| Enums.FormulaType.Master | 1 |
1632| Enums.FormulaType.Shared | 2 |
1633
1634## Rich Text Value
1635
1636Enum: Excel.ValueType.RichText
1637
1638Rich, styled text.
1639
1640E.g.
1641```javascript
1642worksheet.getCell('A1').value = {
1643 richText: [
1644 { text: 'This is '},
1645 {font: {italic: true}, text: 'italic'},
1646 ]
1647};
1648```
1649
1650## Boolean Value
1651
1652Enum: Excel.ValueType.Boolean
1653
1654E.g.
1655
1656```javascript
1657worksheet.getCell('A1').value = true;
1658worksheet.getCell('A2').value = false;
1659```
1660
1661## Error Value
1662
1663Enum: Excel.ValueType.Error
1664
1665E.g.
1666
1667```javascript
1668worksheet.getCell('A1').value = { error: '#N/A' };
1669worksheet.getCell('A2').value = { error: '#VALUE!' };
1670```
1671
1672The current valid Error text values are:
1673
1674| Name | Value |
1675| ------------------------------ | ----------- |
1676| Excel.ErrorValue.NotApplicable | #N/A |
1677| Excel.ErrorValue.Ref | #REF! |
1678| Excel.ErrorValue.Name | #NAME? |
1679| Excel.ErrorValue.DivZero | #DIV/0! |
1680| Excel.ErrorValue.Null | #NULL! |
1681| Excel.ErrorValue.Value | #VALUE! |
1682| Excel.ErrorValue.Num | #NUM! |
1683
1684# Interface Changes
1685
1686Every effort is made to make a good consistent interface that doesn't break through the versions but regrettably, now and then some things have to change for the greater good.
1687
1688## 0.1.0
1689
1690### Worksheet.eachRow
1691
1692The arguments in the callback function to Worksheet.eachRow have been swapped and changed; it was function(rowNumber,rowValues), now it is function(row, rowNumber) which gives it a look and feel more like the underscore (_.each) function and prioritises the row object over the row number.
1693
1694### Worksheet.getRow
1695
1696This function has changed from returning a sparse array of cell values to returning a Row object. This enables accessing row properties and will facilitate managing row styles and so on.
1697
1698The sparse array of cell values is still available via Worksheet.getRow(rowNumber).values;
1699
1700## 0.1.1
1701
1702### cell.model
1703
1704cell.styles renamed to cell.style
1705
1706## 0.2.44
1707
1708Promises returned from functions switched from Bluebird to native node Promise which can break calling code
1709 if they rely on Bluebird's extra features.
1710
1711To mitigate this the following two changes were added to 0.3.0:
1712
1713* A more fully featured and still browser compatable promise lib is used by default. This lib supports many of the features of Bluebird but with a much lower footprint.
1714* An option to inject a different Promise implementation. See <a href="#config">Config</a> section for more details.
1715
1716# Config
1717
1718ExcelJS now supports dependency injection for the promise library.
1719 You can restore Bluebird promises by including the following code in your module...
1720
1721```javascript
1722ExcelJS.config.setValue('promise', require('bluebird'));
1723```
1724
1725Please note: I have tested ExcelJS with bluebird specifically (since up until recently this was the library it used).
1726 From the tests I have done it will not work with Q.
1727
1728# Known Issues
1729
1730## Testing with PhantomJS
1731
1732You may need to install phantomjs globally before running the browser-test script.
1733
1734It's also possible that phantomjs will not run (or can't be found). If this happens, try the following:
1735
1736```bash
1737sudo apt-get install libfontconfig
1738```
1739
1740## Splice vs Merge
1741
1742If any splice operation affects a merged cell, the merge group will not be moved correctly
1743
1744# Release History
1745
1746| Version | Changes |
1747| ------- | ------- |
1748| 0.0.9 | <ul><li><a href="#number-formats">Number Formats</a></li></ul> |
1749| 0.1.0 | <ul><li>Bug Fixes<ul><li>"&lt;" and "&gt;" text characters properly rendered in xlsx</li></ul></li><li><a href="#columns">Better Column control</a></li><li><a href="#rows">Better Row control</a></li></ul> |
1750| 0.1.1 | <ul><li>Bug Fixes<ul><li>More textual data written properly to xml (including text, hyperlinks, formula results and format codes)</li><li>Better date format code recognition</li></ul></li><li><a href="#fonts">Cell Font Style</a></li></ul> |
1751| 0.1.2 | <ul><li>Fixed potential race condition on zip write</li></ul> |
1752| 0.1.3 | <ul><li><a href="#alignment">Cell Alignment Style</a></li><li><a href="#rows">Row Height</a></li><li>Some Internal Restructuring</li></ul> |
1753| 0.1.5 | <ul><li>Bug Fixes<ul><li>Now handles 10 or more worksheets in one workbook</li><li>theme1.xml file properly added and referenced</li></ul></li><li><a href="#borders">Cell Borders</a></li></ul> |
1754| 0.1.6 | <ul><li>Bug Fixes<ul><li>More compatable theme1.xml included in XLSX file</li></ul></li><li><a href="#fills">Cell Fills</a></li></ul> |
1755| 0.1.8 | <ul><li>Bug Fixes<ul><li>More compatable theme1.xml included in XLSX file</li><li>Fixed filename case issue</li></ul></li><li><a href="#fills">Cell Fills</a></li></ul> |
1756| 0.1.9 | <ul><li>Bug Fixes<ul><li>Added docProps files to satisfy Mac Excel users</li><li>Fixed filename case issue</li><li>Fixed worksheet id issue</li></ul></li><li><a href="#set-workbook-properties">Core Workbook Properties</a></li></ul> |
1757| 0.1.10 | <ul><li>Bug Fixes<ul><li>Handles File Not Found error</li></ul></li><li><a href="#csv">CSV Files</a></li></ul> |
1758| 0.1.11 | <ul><li>Bug Fixes<ul><li>Fixed Vertical Middle Alignment Issue</li></ul></li><li><a href="#styles">Row and Column Styles</a></li><li><a href="#rows">Worksheet.eachRow supports options</a></li><li><a href="#rows">Row.eachCell supports options</a></li><li><a href="#columns">New function Column.eachCell</a></li></ul> |
1759| 0.2.0 | <ul><li><a href="#streaming-xlxs-writer">Streaming XLSX Writer</a><ul><li>At long last ExcelJS can support writing massive XLSX files in a scalable memory efficient manner. Performance has been optimised and even smaller spreadsheets can be faster to write than the document writer. Options have been added to control the use of shared strings and styles as these can both have a considerable effect on performance</li></ul></li><li><a href="#rows">Worksheet.lastRow</a><ul><li>Access the last editable row in a worksheet.</li></ul></li><li><a href="#rows">Row.commit()</a><ul><li>For streaming writers, this method commits the row (and any previous rows) to the stream. Committed rows will no longer be editable (and are typically deleted from the worksheet object). For Document type workbooks, this method has no effect.</li></ul></li></ul> |
1760| 0.2.2 | <ul><li><a href="https://pbs.twimg.com/profile_images/2933552754/fc8c70829ee964c5542ae16453503d37.jpeg">One Billion Cells</a><ul><li>Achievement Unlocked: A simple test using ExcelJS has created a spreadsheet with 1,000,000,000 cells. Made using random data with 100,000,000 rows of 10 cells per row. I cannot validate the file yet as Excel will not open it and I have yet to implement the streaming reader but I have every confidence that it is good since 1,000,000 rows loads ok.</li></ul></li></ul> |
1761| 0.2.3 | <ul><li>Bug Fixes<ul><li><a href="https://github.com/guyonroche/exceljs/issues/18">Merge Cell Styles</a><ul><li>Merged cells now persist (and parse) their styles.</li></ul></li></ul></li><li><a href="#streaming-xlxs-writer">Streaming XLSX Writer</a><ul><li>At long last ExcelJS can support writing massive XLSX files in a scalable memory efficient manner. Performance has been optimised and even smaller spreadsheets can be faster to write than the document writer. Options have been added to control the use of shared strings and styles as these can both have a considerable effect on performance</li></ul></li><li><a href="#rows">Worksheet.lastRow</a><ul><li>Access the last editable row in a worksheet.</li></ul></li><li><a href="#rows">Row.commit()</a><ul><li>For streaming writers, this method commits the row (and any previous rows) to the stream. Committed rows will no longer be editable (and are typically deleted from the worksheet object). For Document type workbooks, this method has no effect.</li></ul></li></ul> |
1762| 0.2.4 | <ul><li>Bug Fixes<ul><li><a href="https://github.com/guyonroche/exceljs/issues/27">Worksheets with Ampersand Names</a><ul><li>Worksheet names are now xml-encoded and should work with all xml compatable characters</li></ul></li></ul></li><li><a href="#rows">Row.hidden</a> & <a href="#columns">Column.hidden</a><ul><li>Rows and Columns now support the hidden attribute.</li></ul></li><li><a href="#worksheet">Worksheet.addRows</a><ul><li>New function to add an array of rows (either array or object form) to the end of a worksheet.</li></ul></li></ul> |
1763| 0.2.6 | <ul><li>Bug Fixes<ul><li><a href="https://github.com/guyonroche/exceljs/issues/87">invalid signature: 0x80014</a>: Thanks to <a href="https://github.com/hasanlussa">hasanlussa</a> for the PR</li></ul></li><li><a href="#defined-names">Defined Names</a><ul><li>Cells can now have assigned names which may then be used in formulas.</li></ul></li><li>Converted Bluebird.defer() to new Bluebird(function(resolve, reject){}). Thanks to user <a href="https://github.com/Nishchit14">Nishchit</a> for the Pull Request</li></ul> |
1764| 0.2.7 | <ul><li><a href="#data-validations">Data Validations</a><ul><li>Cells can now define validations that controls the valid values the cell can have</li></ul></li></ul> |
1765| 0.2.8 | <ul><li><a href="rich-text">Rich Text Value</a><ul><li>Cells now support <b><i>in-cell</i></b> formatting - Thanks to <a href="https://github.com/pvadam">Peter ADAM</a></li></ul></li><li>Fixed typo in README - Thanks to <a href="https://github.com/MRdNk">MRdNk</a></li><li>Fixing emit in worksheet-reader - Thanks to <a href="https://github.com/alangunning">Alan Gunning</a></li><li>Clearer Docs - Thanks to <a href="https://github.com/miensol">miensol</a></li></ul> |
1766| 0.2.9 | <ul><li>Fixed "read property 'richText' of undefined error. Thanks to <a href="https://github.com/james075">james075</a></li></ul> |
1767| 0.2.10 | <ul><li>Refactoring Complete. All unit and integration tests pass.</li></ul> |
1768| 0.2.11 | <ul><li><a href="#outline-level">Outline Levels</a>. Thanks to <a href="https://github.com/cricri">cricri</a> for the contribution.</li><li><a href="#worksheet-properties">Worksheet Properties</a></li><li>Further refactoring of worksheet writer.</li></ul> |
1769| 0.2.12 | <ul><li><a href="#worksheet-views">Sheet Views</a>. Thanks to <a href="https://github.com/cricri">cricri</a> again for the contribution.</li></ul> |
1770| 0.2.13 | <ul><li>Fix for <a href="https://github.com/guyonroche/exceljs/issues">exceljs might be vulnerable for regular expression denial of service</a>. Kudos to <a href="https://github.com/yonjah">yonjah</a> and <a href="https://www.youtube.com/watch?v=wCfE-9bhY2Y">Josh Emerson</a> for the resolution.</li><li>Fix for <a href="https://github.com/guyonroche/exceljs/issues/162">Multiple Sheets opens in 'Group' mode in Excel</a>. My bad - overzealous sheet view code.</li><li>Also fix for empty sheet generating invalid xlsx.</li></ul> |
1771| 0.2.14 | <ul><li>Fix for <a href="https://github.com/guyonroche/exceljs/issues">exceljs might be vulnerable for regular expression denial of service</a>. Kudos to <a href="https://github.com/yonjah">yonjah</a> and <a href="https://www.youtube.com/watch?v=wCfE-9bhY2Y">Josh Emerson</a> for the resolution.</li><li>Fixed <a href="https://github.com/guyonroche/exceljs/issues/162">Multiple Sheets opens in 'Group' mode in Excel</a> again. Added <a href="#workbook-views">Workbook views</a>.</li><li>Also fix for empty sheet generating invalid xlsx.</li></ul> |
1772| 0.2.15 | <ul><li>Added <a href="#page-setup">Page Setup Properties</a>. Thanks to <a href="https://github.com/jackkum">Jackkum</a> for the PR</li></ul> |
1773| 0.2.16 | <ul><li>New <a href="#page-setup">Page Setup</a> Property: Print Area</li></ul> |
1774| 0.2.17 | <ul><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/114">Fix a bug on phonetic characters</a>. This fixes an issue related to reading workbooks with phonetic text in. Note phonetic text is not properly supported yet - just properly ignored. Thanks to <a href="https://github.com/zephyrrider">zephyrrider</a> and <a href="https://github.com/gen6033">gen6033</a> for the contribution.</li></ul> |
1775| 0.2.18 | <ul><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/175">Fix regression #150: Stream API fails to write XLSX files</a>. Apologies for the regression! Thanks to <a href="https://github.com/danieleds">danieleds</a> for the fix.</li><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/114">Fix a bug on phonetic characters</a>. This fixes an issue related to reading workbooks with phonetic text in. Note phonetic text is not properly supported yet - just properly ignored. Thanks to <a href="https://github.com/zephyrrider">zephyrrider</a> and <a href="https://github.com/gen6033">gen6033</a> for the contribution.</li></ul> |
1776| 0.2.19 | <ul><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/119">Update xlsx.js #119</a>. This should make parsing more resilient to open-office documents. Thanks to <a href="https://github.com/nvitaterna">nvitaterna</a> for the contribution.</li></ul> |
1777| 0.2.20 | <ul><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/179">Changes from guyonroche/exceljs#127 applied to latest version #179</a>. Fixes parsing of defined name values. Thanks to <a href="https://github.com/agdevbridge">agdevbridge</a> and <a href="https://github.com/priitliivak">priitliivak</a> for the contribution.</li></ul> |
1778| 0.2.21 | <ul><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/135">color tabs for worksheet-writer #135</a>. Modified the behaviour to print deprecation warning as tabColor has moved into options.properties. Thanks to <a href="https://github.com/ethanlook">ethanlook</a> for the contribution.</li></ul> |
1779| 0.2.22 | <ul><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/136">Throw legible error when failing Value.getType() #136</a>. Thanks to <a href="https://github.com/wulfsolter">wulfsolter</a> for the contribution.</li><li>Honourable mention to contributors whose PRs were fixed before I saw them:<ul><li><a href="https://github.com/haoliangyu">haoliangyu</a></li><li><a href="https://github.com/wulfsolter">wulfsolter</a></li></ul></li></ul> |
1780| 0.2.23 | <ul><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/137">Fall back to JSON.stringify() if unknown Cell.Type #137</a> with some modification. If a cell value is assigned to an unrecognisable javascript object, the stored value in xlsx and csv files will be JSON stringified. Note that if the file is read again, no attempt will be made to parse the stringified JSON text. Thanks to <a href="https://github.com/wulfsolter">wulfsolter</a> for the contribution.</li></ul> |
1781| 0.2.24 | <ul><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/166">Protect cell fix #166</a>. This does not mean full support for protected cells merely that the parser is not confused by the extra xml. Thanks to <a href="https://github.com/jayflo">jayflo</a> for the contribution.</li></ul> |
1782| 0.2.25 | <ul><li>Added functions to delete cells, rows and columns from a worksheet. Modelled after the Array splice method, the functions allow cells, rows and columns to be deleted (and optionally inserted). See <a href="#columns">Columns</a> and <a href="#rows">Rows</a> for details.<br />Note: <a href="#splice-vs-merge">Not compatable with cell merges</a></li></ul> |
1783| 0.2.26 | <ul><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/184">Update border-xform.js #184</a>Border edges without style will be parsed and rendered as no-border. Thanks to <a href="https://github.com/skumarnk2">skumarnk2</a> for the contribution.</li></ul> |
1784| 0.2.27 | <ul><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/187">Pass views to worksheet-writer #187</a>. Now also passes views to worksheet-writer. Thanks to <a href="https://github.com/Temetz">Temetz</a> for the contribution.</li><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/189">Do not escape xml characters when using shared strings #189</a>. Fixing bug in shared strings. Thanks to <a href="https://github.com/tkirda">tkirda</a> for the contribution.</li></ul> |
1785| 0.2.28 | <ul><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/190">Fix tiny bug [Update hyperlink-map.js] #190</a>Thanks to <a href="https://github.com/lszlkss">lszlkss</a> for the contribution.</li><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/196">fix typo on sheet view showGridLines option #196</a> "showGridlines" should have been "showGridLines". Thanks to <a href="https://github.com/gadiaz1">gadiaz1</a> for the contribution.</li></ul> |
1786| 0.2.29 | <ul><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/199">Fire finish event instead of end event on write stream #199</a> and <a href="https://github.com/guyonroche/exceljs/pull/200">Listen for finish event on zip stream instead of middle stream #200</a>. Fixes issues with stream completion events. Thanks to <a href="https://github.com/junajan">junajan</a> for the contribution.</li></ul> |
1787| 0.2.30 | <ul><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/201">Fix issue #178 #201</a>. Adds the following properties to workbook:<ul><li>title</li><li>subject</li><li>keywords</li><li>category</li><li>description</li><li>company</li><li>manager</li></ul>Thanks to <a href="https://github.com/stavenko">stavenko</a> for the contribution.</li></ul> |
1788| 0.2.31 | <ul><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/203">Fix issue #163: the "spans" attribute of the row element is optional #203</a>. Now xlsx parsing will handle documents without row spans. Thanks to <a href="https://github.com/arturas-vitkauskas">arturas-vitkauskas</a> for the contribution.</li></ul> |
1789| 0.2.32 | <ul><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/208">Fix issue 206 #208</a>. Fixes issue reading xlsx files that have been printed. Also adds "lastPrinted" property to Workbook. Thanks to <a href="https://github.com/arturas-vitkauskas">arturas-vitkauskas</a> for the contribution.</li></ul> |
1790| 0.2.33 | <ul><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/210">Allow styling of cells with no value. #210</a>. Includes Null type cells with style in the rendering parsing. Thanks to <a href="https://github.com/oferns">oferns</a> for the contribution.</li></ul> |
1791| 0.2.34 | <ul><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/212">Fix "Unexpected xml node in parseOpen" bug in LibreOffice documents for attributes dc:language and cp:revision #212</a>. Thanks to <a href="https://github.com/jessica-jordan">jessica-jordan</a> for the contribution.</li></ul> |
1792| 0.2.35 | <ul><li>Fixed <a href="https://github.com/guyonroche/exceljs/issues/74">Getting a column/row count #74</a>. <a href="#worksheet-metrics">Worksheet</a> now has rowCount and columnCount properties (and actual variants), <a href="row">Row</a> has cellCount.</li></ul> |
1793| 0.2.36 | <ul><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/217">Stream reader fixes #217</a>. Thanks to <a href="https://github.com/kturney">kturney</a> for the contribution.</li></ul> |
1794| 0.2.37 | <ul><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/225">Fix output order of Sheet Properties #225</a>. Thanks to <a href="https://github.com/keeneym">keeneym</a> for the contribution.</li><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/231">remove empty worksheet[0] from _worksheets #231</a>. Thanks to <a href="https://github.com/pookong">pookong</a> for the contribution.</li><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/232">do not skip empty string in shared strings so that indexes match #232</a>. Thanks again to <a href="https://github.com/pookong">pookong</a> for the contribution.</li><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/233">use shared strings for streamed writes #233</a>. Thanks again to <a href="https://github.com/pookong">pookong</a> for the contribution.</li></ul> |
1795| 0.2.38 | <ul><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/236">Add a comment for issue #216 #236</a>. Thanks to <a href="https://github.com/jsalwen">jsalwen</a> for the contribution.</li><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/237">Start on support for 1904 based dates #237</a>. Fixed date handling in documents with the 1904 flag set. Thanks to <a href="https://github.com/holm">holm</a> for the contribution.</li></ul> |
1796| 0.2.39 | <ul><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/245">Stops Bluebird warning about unreturned promise #245</a>. Thanks to <a href="https://github.com/robinbullocks4rb">robinbullocks4rb</a> for the contribution. </li> <li> Merged <a href="https://github.com/guyonroche/exceljs/pull/247">Added missing dependency: col-cache.js #247</a>. Thanks to <a href="https://github.com/Manish2005">Manish2005</a> for the contribution. </li> </ul> |
1797| 0.2.42 | <ul><li>Browser Compatable!<ul><li>Well mostly. I have added a browser sub-folder that contains a browserified bundle and an index.js that can be used to generate another. See <a href="#browser">Browser</a> section for details.</li></ul></li><li>Fixed corrupted theme.xml. Apologies for letting that through.</li><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/253">[BUGFIX] data validation formulae undefined #253</a>. Thanks to <a href="https://github.com/jayflo">jayflo</a> for the contribution.</li></ul> |
1798| 0.2.43 | <ul><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/255">added a (maybe partial) solution to issue 99. i wasn't able to create an appropriate test #255</a>. This fixes <a href="https://github.com/guyonroche/exceljs/issues/99">Too few data or empty worksheet generate malformed excel file #99</a>. Thanks to <a href="https://github.com/mminuti">mminuti</a> for the contribution.</li></ul> |
1799| 0.2.44 | <ul><li>Reduced Dependencies.<ul><li>Goodbye lodash, goodbye bluebird. Minified bundle is now just over half what it was in the first version.</li></ul></li></ul> |
1800| 0.2.45 | <ul><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/256">Sheets with hyperlinks and data validations are corrupted #256</a>. Thanks to <a href="https://github.com/simon-stoic">simon-stoic</a> for the contribution.</li></ul> |
1801| 0.2.46 | <ul><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/259">Exclude character controls from XML output. Fixes #234 #262</a>. Thanks to <a href="https://github.com/holm">holm</a> for the contribution.</li><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/262">Add support for identifier #259</a>. This fixes <a href="https://github.com/guyonroche/exceljs/issues/234">Broken XLSX because of "vertical tab" ascii character in a cell #234</a>. Thanks to <a href="https://github.com/NOtherDev">NOtherDev</a> for the contribution.</li></ul> |
1802| 0.3.0 | <ul><li>Addressed <a href="https://github.com/guyonroche/exceljs/issues/266">Breaking change removing bluebird #266</a>. Appologies for any inconvenience.</li><li>Added Promise library dependency injection. See <a href="#config">Config</a> section for more details.</li></ul> |
1803| 0.3.1 | <ul><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/279">Update dependencies #279</a>. Thanks to <a href="https://github.com/holm">holm</a> for the contribution.</li><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/267">Minor fixes for stream handling #267</a>. Thanks to <a href="https://github.com/holm">holm</a> for the contribution.</li><li>Added automated tests in phantomjs for the browserified code.</li></ul> |
1804| 0.4.0 | <ul><li>Fixed issue <a href="https://github.com/guyonroche/exceljs/issues/278">Boolean cell with value ="true" is returned as 1 #278</a>. The fix involved adding two new Call Value types:<ul><li><a href="#boolean-value">Boolean Value</a></li><li><a href="#error-value">Error Value</a></li></ul>Note: Minor version has been bumped up to 4 as this release introduces a couple of interface changes:<ul><li>Boolean cells previously will have returned 1 or 0 will now return true or false</li><li>Error cells that previously returned a string value will now return an error structure</li></ul></li><li>Fixed issue <a href="https://github.com/guyonroche/exceljs/issues/280">Code correctness - setters don't return a value #280</a>.</li><li>Addressed issue <a href="https://github.com/guyonroche/exceljs/issues/288">v0.3.1 breaks meteor build #288</a>.</li></ul> |
1805| 0.4.1 | <ul><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/285">Add support for cp:contentStatus #285</a>. Thanks to <a href="https://github.com/holm">holm</a> for the contribution.</li><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/286">Fix Valid characters in XML (allow \n and \r when saving) #286</a>. Thanks to <a href="https://github.com/Rycochet">Rycochet</a> for the contribution.</li><li>Fixed <a href="https://github.com/guyonroche/exceljs/issues/275">hyperlink with query arguments corrupts workbook #275</a>. The hyperlink target is not escaped before serialising in the xml.</li></ul> |
1806| 0.4.2 | <ul><li><p>Addressed the following issues:<ul><li><a href="https://github.com/guyonroche/exceljs/issues/290">White text and borders being changed to black #290</a></li><li><a href="https://github.com/guyonroche/exceljs/issues/261">Losing formatting/pivot table from loaded file #261</a></li><li><a href="https://github.com/guyonroche/exceljs/issues/272">Solid fill become black #272</a></li></ul>These issues are potentially caused by a bug that caused colours with zero themes, tints or indexes to be rendered and parsed incorrectly.</p><p>Regarding themes: the theme files stored inside the xlsx container hold important information regarding colours, styles etc and if the theme information from a loaded xlsx file is lost, the results can be unpredictable and undesirable. To address this, when an ExcelJS Workbook parses an XLSX file, it will preserve any theme files it finds and include them when writing to a new XLSX. If this behaviour is not desired, the Workbook class exposes a clearThemes() function which will drop the theme content. Note that this behaviour is only implemented in the document based Workbook class, not the streamed Reader and Writer.</p></li></ul> |
1807| 0.4.3 | <ul><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/294">Support error references in cell ranges #294</a>. Thanks to <a href="https://github.com/holm">holm</a> for the contribution.</li></ul> |
1808| 0.4.4 | <ul><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/297">Issue with copied cells #297</a>. This merge adds support for shared formulas. Thanks to <a href="https://github.com/muscapades">muscapades</a> for the contribution.</li></ul> |
1809| 0.4.6 | <ul><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/304">Correct spelling #304</a>. Thanks to <a href="https://github.com/toanalien">toanalien</a> for the contribution.</li><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/304">Added support for auto filters #306</a>. This adds <a href="#auto-filters">Auto Filters</a> to the Worksheet. Thanks to <a href="https://github.com/C4rmond4i">C4rmond4i</a> for the contribution.</li><li>Restored NodeJS 4.0.0 compatability by removing the destructuring code. My apologies for any inconvenience.</li></ul> |
1810| 0.4.9 | <ul><li>Switching to transpiled code for distribution. This will ensure compatability with 4.0.0 and above from here on. And it will also allow use of much more expressive JS code in the lib folder!</li><li><a href="#images">Basic Image Support!</a>Images can now be added to worksheets either as a tiled background or stretched over a range. Note: other features like rotation, etc. are not supported yet and will reqeuire further work.</li></ul> |
1811| 0.4.10 | <ul><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/319">Add missing Office Rels #319</a>. Thanks goes to <a href="https://github.com/mauriciovillalobos">mauriciovillalobos</a> for the contribution.</li><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/320">Add printTitlesRow Support #320</a> Thanks goes to <a href="https://github.com/psellers89">psellers89</a> for the contribution.</li></ul> |
1812| 0.4.11 | <ul><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/327">Avoid error on anchor with no media #327</a>. Thanks goes to <a href="https://github.com/holm">holm</a> for the contribution.</li><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/332">Assortment of fixes for streaming read #332</a>. Thanks goes to <a href="https://github.com/holm">holm</a> for the contribution.</li></ul> |
1813| 0.4.12 | <ul><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/334">Don’t set address if hyperlink r:id is undefined #334</a>. Thanks goes to <a href="https://github.com/holm">holm</a> for the contribution.</li></ul> |
1814| 0.4.13 | <ul><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/343">Issue 296 #343</a>. This fixes <a href="https://github.com/guyonroche/exceljs/issues/296">Issue with writing newlines #296</a>. Thanks goes to <a href="https://github.com/holly-weisser">holly-weisser</a> for the contribution.</li></ul> |
1815| 0.4.14 | <ul><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/350">Syntax highlighting added ✨ #350</a>. Thanks goes to <a href="https://github.com/rmariuzzo">rmariuzzo</a> for the contribution.</li></ul> |
1816| 0.5.0 | <ul><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/356">Fix right to left issues #356</a>. Fixes <a href="https://github.com/guyonroche/exceljs/issues/72">Add option to RTL file #72</a> and <a href="https://github.com/guyonroche/exceljs/issues/126">Adding an option to set RTL worksheet #126</a>. Big thank you to <a href="https://github.com/alitaheri">alitaheri</a> for this contribution.</li></ul> |
1817| 0.5.1 | <ul><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/364">Fix #345 TypeError: Cannot read property 'date1904' of undefined #364</a>. This fixes <a href="https://github.com/guyonroche/exceljs/issues/345">TypeError: Cannot read property 'date1904' of undefined #345</a>. Thanks to <a href="https://github.com/Diluka">Diluka</a> for this contribution.</li></ul>
1818| 0.6.0 | <ul><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/389">Add rowBreaks feature. #389</a>. Thanks to <a href="https://github.com/brucejo75">brucejo75</a> for this contribution.</li></ul> |
1819| 0.6.1 | <ul><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/403">Guard null model fields - fix and tests #403</a>. Thanks to <a href="https://github.com/shdd-cjharries">thecjharries</a> for this contribution. Also thanks to <a href="https://github.com/Rycochet">Ryc O'Chet</a> for help with reviewing.</li></ul> |
1820| 0.6.2 | <ul><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/396">Add some comments in readme according csv importing #396</a>. Thanks to <a href="https://github.com/Imperat">Michael Lelyakin</a> for this contribution. Also thanks to <a href="https://github.com/planemar">planemar</a> for help with reviewing. This also closes <a href="https://github.com/guyonroche/exceljs/issues/395">csv to stream doesn't work #395</a>.</li></ul> |
1821| 0.7.0 | <ul><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/407">Impl &lt;xdr:twoCellAnchor editAs=oneCell&gt; #407</a>. Thanks to <a href="https://github.com/Ockejanssen">Ocke Janssen</a> and <a href="https://github.com/kay-ramme">Kay Ramme</a> for this contribution. This change allows control on how images are anchored to cells.</li></ul> |
1822| 0.7.1 | <ul><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/423">Don't break when attempting to import a zip file that's not an Excel file (eg. .numbers) #423</a>. Thanks to <a href="https://github.com/papandreou">Andreas Lind</a> for this contribution. This change makes exceljs more reslilient when opening non-excel files.</li><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/434">Fixes #419 : Updates readme. #434</a>. Thanks to <a href="https://github.com/getsomecoke">Vishnu Kyatannawar</a> for this contribution.</li><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/436">Don't break when docProps/core.xml contains a &lt;cp:version&gt; tag #436</a>. Thanks to <a href="https://github.com/papandreou">Andreas Lind</a> for this contribution. This change handles core.xml files with empty version tags.</li></ul>
1823| 0.8.0 | <ul><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/442">Add Base64 Image support for the .addImage() method #442</a>. Thanks to <a href="https://github.com/jwmann">James W Mann</a> for this contribution.</li><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/453">update moment to 2.19.3 #453</a>. Thanks to <a href="https://github.com/cooltoast">Markan Patel</a> for this contribution.</li></ul> |
1824| 0.8.1 | <ul><li> Merged <a href="https://github.com/guyonroche/exceljs/pull/457">Additional information about font family property #457</a>. Thanks to <a href="https://github.com/kayakyakr">kayakyakr</a> for this contribution. </li> <li> Merged <a href="https://github.com/guyonroche/exceljs/pull/459">Fixes #458 #459</a>. This fixes <a href="https://github.com/guyonroche/exceljs/issues/458">Add style to column causes it to be hidden #458</a>. Thanks to <a href="https://github.com/AJamesPhillips">Alexander James Phillips</a> for this contribution. </li> </ul> |
1825| 0.8.2 | <ul><li>Merged <a href="https://github.com/guyonroche/exceljs/pull/466">Don't break when loading an Excel file containing a chartsheet #466</a>. Thanks to <a href="https://github.com/papandreou">Andreas Lind</a> for this contribution. </li> <li> Merged <a href="https://github.com/guyonroche/exceljs/pull/471">Hotfix/sheet order#257 #471</a>. This fixes <a href="https://github.com/guyonroche/exceljs/issues/257">Sheet Order #257</a>. Thanks to <a href="https://github.com/robbi">Robbi</a> for this contribution. </li> </ul> |
1826| 0.8.3 | <ul> <li> Assimilated <a href="https://github.com/guyonroche/exceljs/pull/463">fix #79 outdated dependencies in unzip2</a>. Thanks to <a href="https://github.com/jsamr">Jules Sam. Randolph</a> for starting this fix and a really big thanks to <a href="https://github.com/kachkaev">Alexander Kachkaev</a> for finding the final solution. </li> </ul> |
1827| 0.8.4 | <ul> <li> Merged <a href="https://github.com/guyonroche/exceljs/pull/479">Round Excel date to nearest millisecond when converting to javascript date #479</a>. Thanks to <a href="https://github.com/bjet007">Benoit Jean</a> for this contribution. </li> </ul> |
1828| 0.8.5 | <ul> <li> Merged <a href="https://github.com/guyonroche/exceljs/pull/485">Bug fix: wb.worksheets/wb.eachSheet caused getWorksheet(0) to return sheet #485</a>. Thanks to <a href="https://github.com/mah110020">mah110020</a> for this contribution. </li> </ul> |
1829| 0.9.0 | <ul> <li> Merged <a href="https://github.com/guyonroche/exceljs/pull/489">Feature/issue 424 #489</a>. This fixes <a href="https://github.com/guyonroche/exceljs/issues/424">No way to control summaryBelow or summaryRight #424</a>. Many thanks to <a href="https://github.com/sarahdmsi">Sarah</a> for this contribution. </li> </ul> |
1830| 0.9.1 | <ul> <li> Merged <a href="https://github.com/guyonroche/exceljs/pull/490">add type definition #490</a>. This adds type definitions to ExcelJS! Many thanks to <a href="https://github.com/taoqf">taoqf</a> for this contribution. </li> </ul> |
1831| 1.0.0 | <ul> <li> Merged <a href="https://github.com/guyonroche/exceljs/pull/494">Add Node 8 and Node 9 to continuous integration testing #494</a>. Many thanks to <a href="https://github.com/cooltoast">Markan Patel</a> for this contribution. </li> <li> Merged <a href="https://github.com/guyonroche/exceljs/pull/508">Small README fix #508</a>. Many thanks to <a href="https://github.com/lbguilherme">Guilherme Bernal</a> for this contribution. </li> <li> Merged <a href="https://github.com/guyonroche/exceljs/pull/501">Add support for inlineStr, including rich text #501</a>. Many thanks to <a href="https://github.com/linguamatics-pdenes">linguamatics-pdenes</a> and <a href="https://github.com/robscotts4rb">Rob Scott</a> for their efforts towards this contribution. Since this change is technically a breaking change (the rendered XML for inline strings will change) I'm making this a major release! </li> </ul> |
1832| 1.0.1 | <ul> <li> Fixed <a href="https://github.com/guyonroche/exceljs/issues/520">spliceColumns problem when the number of columns are important #520</a>. </li> </ul> |
1833| 1.0.2 | <ul> <li> Merged <a href="https://github.com/guyonroche/exceljs/pull/524">Loosen exceljs's dependency requirements for moment #524</a>. Many thanks to <a href="https://github.com/nicoladefranceschi">nicoladefranceschi</a> for this contribution. This change addresses <a href="https://github.com/guyonroche/exceljs/issues/517">Ability to use external "moment" package #517</a>. </li> </ul> |
1834| 1.1.0 | <ul> <li> Addressed <a href="https://github.com/guyonroche/exceljs/issues/514">Is there a way inserting values in columns. #514</a>. Added a new getter/setter property to Column to get and set column values (see <a href="#columns">Columns</a> for details). </li> </ul> |
1835| 1.1.1 | <ul> <li> Merged <a href="https://github.com/guyonroche/exceljs/pull/532">Include index.d.ts in published packages #532</a>. To fix <a href="https://github.com/guyonroche/exceljs/issues/525">TypeScript definitions missing from npm package #525</a>. Many thanks to <a href="https://github.com/saschanaz">Kagami Sascha Rosylight</a> for this contribution. </li> </ul> |
1836| 1.1.2 | <ul> <li> Merged <a href="https://github.com/guyonroche/exceljs/pull/536">Don't break when docProps/core.xml contains <cp:contentType /> #536</a>. Many thanks to <a href="https://github.com/papandreou">Andreas Lind</a> (and reviewers) for this contribution. </li> </ul> |
1837| 1.1.3 | <ul> <li> Merged <a href="https://github.com/guyonroche/exceljs/pull/537">Try to handle the case where a &lt;c&gt; element is missing an r attribute #537</a>. Many thanks to <a href="https://github.com/papandreou">Andreas Lind</a> for this contribution. </li> </ul> |
1838| 1.2.0 | <ul> <li> Merged <a href="https://github.com/guyonroche/exceljs/pull/544">Add dateUTC flag to CSV Writing #544</a>. Many thanks to <a href="https://github.com/zgriesinger">Zackery Griesinger</a> for this contribution. </li> </ul> |
1839| 1.2.1 | <ul> <li> Merged <a href="https://github.com/guyonroche/exceljs/pull/547">worksheet name is writable #547</a>. Many thanks to <a href="https://github.com/f111fei">xzper</a> for this contribution. </li> </ul> |
1840| 1.3.0 | <ul> <li> Merged <a href="https://github.com/guyonroche/exceljs/pull/549">Add CSV write buffer support #549</a>. Many thanks to <a href="https://github.com/jloveridge">Jarom Loveridge</a> for this contribution. </li> </ul> |
1841| 1.4.2 | <ul> <li> Merged <a href="https://github.com/guyonroche/exceljs/pull/541">Discussion: Customizable row/cell limit #541</a>. Many thanks to <a href="https://github.com/papandreou">Andreas Lind</a> for this contribution. </li> </ul> |
1842| 1.4.3 | <ul> <li> Merged <a href="https://github.com/guyonroche/exceljs/pull/552">Get the right text out of hyperlinked formula cells #552</a>. Many thanks to <a href="https://github.com/papandreou">Andreas Lind</a> and <a href="https://github.com/holm">Christian Holm</a> for this contribution. </li> </ul> |
1843| 1.4.5 | <ul> <li> Merged <a href="https://github.com/guyonroche/exceljs/pull/556">Add test case with a huge file #556</a>. Many thanks to <a href="https://github.com/papandreou">Andreas Lind</a> and <a href="https://github.com/holm">Christian Holm</a> for this contribution. </li> </ul> |
1844| 1.4.6 | <ul> <li> Merged <a href="https://github.com/guyonroche/exceljs/pull/557">Update README.md to reflect correct functionality of row.addPageBreak() #557</a>. Many thanks to <a href="https://github.com/raj7desai">RajDesai</a> for this contribution. </li> <li> Merged <a href="https://github.com/guyonroche/exceljs/pull/558">fix index.d.ts #558</a>. Many thanks to <a href="https://github.com/Diluka">Diluka</a> for this contribution. </li> </ul> |
1845| 1.4.7 | <ul> <li> Merged <a href="https://github.com/guyonroche/exceljs/pull/562">List /xl/sharedStrings.xml in [Content_Types].xml only if one of the … #562</a>. Many thanks to <a href="https://github.com/priidikvaikla">Priidik Vaikla</a> for this contribution. </li> </ul> |
1846| 1.4.8 | <ul> <li> Merged <a href="https://github.com/guyonroche/exceljs/pull/562">List /xl/sharedStrings.xml in [Content_Types].xml only if one of the … #562</a>. Many thanks to <a href="https://github.com/priidikvaikla">Priidik Vaikla</a> for this contribution. </li> <li> Fixed issue with above where shared strings were used but the content type was not added. </li> </ul> |
1847| 1.4.9 | <ul> <li> Merged <a href="https://github.com/guyonroche/exceljs/pull/562">List /xl/sharedStrings.xml in [Content_Types].xml only if one of the … #562</a>. Many thanks to <a href="https://github.com/priidikvaikla">Priidik Vaikla</a> for this contribution. </li> <li> Fixed issue with above where shared strings were used but the content type was not added. </li> <li> Fixed issue <a href="https://github.com/guyonroche/exceljs/issues/581">1.4.8 broke writing Excel files with useSharedStrings:true #581</a>. </li> </ul> |
1848| 1.4.10 | <ul> <li> Merged <a href="https://github.com/guyonroche/exceljs/pull/564">core-xform: Tolerate a missing cp: namespace for the coreProperties element #564</a>. Many thanks to <a href="https://github.com/papandreou">Andreas Lind</a> for this contribution. </li> </ul> |
1849| 1.4.12 | <ul> <li> Merged <a href="https://github.com/guyonroche/exceljs/pull/567">Avoid error on malformed address #567</a>. Many thanks to <a href="https://github.com/papandreou">Andreas Lind</a> for this contribution. </li> <li> Merged <a href="https://github.com/guyonroche/exceljs/pull/571">Added a missing Promise&lt;void&gt; in index.d.ts #571</a>. Many thanks to <a href="https://github.com/carboneater">Gabriel Fournier</a> for this contribution. This release should fix <a href="https://github.com/guyonroche/exceljs/issues/548">Is workbook.commit() still a promise or not #548</a> </li> </ul> |
1850| 1.4.13 | <ul> <li> Merged <a href="https://github.com/guyonroche/exceljs/pull/574">Issue #488 #574</a>. Many thanks to <a href="https://github.com/dljenkins">dljenkins</a> for this contribution. This release should fix <a href="https://github.com/guyonroche/exceljs/issues/488">Invalid time value Exception #488</a>. </li> </ul> |
1851| 1.5.0 | <ul> <li> Merged <a href="https://github.com/guyonroche/exceljs/pull/577">Sheet add state for hidden or show #577</a>. Many thanks to <a href="https://github.com/Hsinfu">Freddie Hsinfu Huang</a> for this contribution. This release should fix <a href="https://github.com/guyonroche/exceljs/issues/226">hide worksheet and reorder sheets #226</a>. </li> </ul> |
1852