How to add a breakline inside a cell with Excel4node module in NodeJs

I need to insert a multiline cell with module excel4node, in documentation I didn’t found anything about this. I tried to insert the escape sequence "n" but it didn’t work. This is my code:

var xl = require('excel4node');
var wb = new xl.Workbook();
var ws = wb.addWorksheet('Sheet 1');

ws.cell(1, 1).string('first line n second line');

And this is the result inside the cell:

first line n second line

Somebody knows how it’s possible to insert a multiline cell? Which char must I use?

Answer

My friendo

Have you tried this way?

ws.cell(1, 1).formula('="first line"&CHAR(10)&"second line"');

Leave a Reply

Your email address will not be published. Required fields are marked *