[BUG] Unable to specify a note in a cell within a table
See original GitHub issue🐛 Bug Report
Lib version: 4.1.0 (latest)
I cannot specify a note in a cell within a table.
Steps To Reproduce
const Excel = require('exceljs');
const workbook = new Excel.Workbook();
const worksheet = workbook.addWorksheet('Test');
const enableTable = true;
const data = [
['Foo', 'Bar', 'Baz'], // Headers
['foo', 'bar', 'baz'],
['foo', 'bar', 'baz'],
['foo', 'bar', 'baz'],
['foo', 'bar', 'baz']
];
for (let ri = 0; ri < data.length; ri++) {
for (let ci = 0; ci < data[ri].length; ci++) {
worksheet.getCell(ri + 1, ci + 1).value = data[ri][ci];
}
}
if (enableTable) {
worksheet.addTable({
name: 'Table1',
ref: 'A1',
headerRow: true,
totalsRow: false,
columns: data[0].map(name => ({ name })),
rows: data.slice(1)
});
}
worksheet.getCell('B3').note = 'Test Note';
workbook.xlsx.writeFile('test.xlsx');
The expected behaviour:
The generated file should open successfully in Excel, with a note written 'Test Note'
in cell B3
.
Screenshots
With enableTable
set to false
, it works, the note is visible:
With enableTable
set to true
, the file is corrupted and Excel can’t repair it (resulting in an empty sheet):
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:12
Top Results From Across the Web
notes attached to cells not visible, broken since last excel ...
I've got many notes (the yellow non-threaded formerly called comments) in my excel sheets. Since the latest software update I can not display/view...
Read more >Using structured references with Excel tables - Microsoft Support
To create the table, select any cell within the data range, and press Ctrl+T. ... Don't use cell references Names can't be the...
Read more >Video: Input and error messages - Microsoft Support
On the Input Message tab, check the box next to Show input message when cell is selected. Type a Title if you want....
Read more >How to Troubleshoot and Fix Excel Pivot Table Errors
1) Locate Pivot Table Data Source · Select any cell in the pivot table. · On the Ribbon, click the PivotTable Analyze tab...
Read more >FILTER() - AppSheet Help - Google Support
Select rows of table or sliceReturns select rows of table or slice as a list ... FILTER("Events", ([Venue] <> [Wanted Venue])) produces the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Nice, thank you very much. I will try it later and comment here if it worked.
Should be pretty simple, just reordering here so that
legacyDrawing
is being output just afterdrawing
.https://github.com/exceljs/exceljs/blob/65ea2e4a52343362e4a7309bf961611392dd6a4a/lib/xlsx/xform/sheet/worksheet-xform.js#L329-L342