Rich text formatting is not rendered when using the Streaming I/O
See original GitHub issueHello there,
In my application I’m building an Excel document row by row and stream each row when it’s done. One cell has rich formatting - some words have specific colours. I think I’m doing the right thing but in the Excel document the cell has the value [Object object]
.
I guess this is the toString()
of the object instead of the correct rendering.
Here is a little example that is failing for me:
var fs = require('fs');
var exceljs = require('exceljs');
var stream = fs.createWriteStream('richtTextStream.xlsx');
var wb = new exceljs.stream.xlsx.WorkbookWriter({'stream': stream, 'useStyles': true});
var ws = wb.addWorksheet('rich');
var row = ws.getRow(2);
var cell = row.getCell(2);
cell.value = {
richText: [
{
font: {color: {argb: '99E391'}},
text: 'This part '
},
{
font: {color: {argb: 'FF6565'}},
text: ' and that one.'
}
]
};
row.commit();
ws.commit();
wb.commit();
If I use a non streaming workbook and write the file using wb.xlsx.writeFile()
then I can see the correct formatting.
Any idea what is going on? Is there some missing rendering logic in the Streaming I/O?
Thanks!
Issue Analytics
- State:
- Created 6 years ago
- Comments:6
Top Results From Across the Web
C# populate RichTextBox with stream -- File Format is not Valid
I am trying to put an .rtf stream into a RichTextBox using this code: ... render the document but the resulting string was...
Read more >Contentful Strategies: How To Render RichText - YouTube
Creating and adjusting new fields in your content model is easy with Contentful's RichText editor. Follow along as Stefon highlights the ...
Read more >Enable or disable full rich-text formatting in a rich text box
Right-click the rich text box for which you want to enable or disable full rich-text formatting, and then click Rich Text Box Properties...
Read more >Rich Text Format (RTF) Version 1.5 Specification - Biblioscape
(Converters that communicate with Microsoft Word for Windows or Microsoft Word for the Macintosh should expect 8-bit characters.) There is no set maximum...
Read more >Handle Rich Text in React - Documentation - Prismic
Learn how to work with rich text in React. Prismic provides the tools to write, save, query, and render rich text content in...
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
Thanks for the suggestion! I used this
'useSharedStrings': true
option and I can see rich text formatting.But it is still not working: if you have multiple rows with rich text formatting all the cells will have the value of the first cell.
The following script illustrates what I’m saying:
The excel document generated will have 2 rows with the same content:
I ran into the same problem with all the richText cells have the same value as the first richText cell, any workaround or any news of a possible fix? Version: 4.2.0