Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

it is not keeping styles... #12

Closed
almottier opened this issue Nov 11, 2015 · 2 comments
Closed

it is not keeping styles... #12

almottier opened this issue Nov 11, 2015 · 2 comments

Comments

@almottier
Copy link

I don't understand, i installed using : npm install xlsx-style

my nodejs script is as simple as this :

var xlsx = require('xlsx-style');
var workbook = xlsx.readFile('template.xlsx');
xlsx.writeFile(workbook, 'out.xlsx');
console.log('Finished');

But all the styles disappeared. Am I missing something ?
Thanks

@VincentGuinaudeau
Copy link

yes, that something i run into a month ago.

I'm not sure that my solution is the best, but i workaround this by turing on the cellStyles attribute on the parsing.

var xlsx = require('xlsx-style');
var workbook = xlsx.readFile('template.xlsx', {cellStyles: true});
xlsx.writeFile(workbook, 'out.xlsx');
console.log('Finished');

By doing this, all the style will by insert in the cell, instead of being list in another part of the workbook.

@pietersv
Copy link
Collaborator

Exactly, {cellStyles: true} is right. That's inherited from the parent project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants