Skip to content

Rich text formatting is not rendered when using the Streaming I/O #409

Closed
@Kylir

Description

@Kylir

Hello 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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy