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

Store cells as excel number and not as excel text #49

Open
mattwilsn opened this issue Nov 17, 2015 · 5 comments
Open

Store cells as excel number and not as excel text #49

mattwilsn opened this issue Nov 17, 2015 · 5 comments

Comments

@mattwilsn
Copy link

var sheet = workbook.createSheet('mySheet', 3, 3);

var myInt = 42;

sheet.set(2,4,myInt);

on save/create of mySheet excel myInt is created as a text input.

I have to manually convert every cell to an excel number.

Is there a way to create a workbook with numbers and not text?

@pietersv
Copy link

In the meantime, an option is to copy https://raw.githubusercontent.com/protobi/msexcel-builder/master/lib/msexcel-builder.js to your project. Let me know if this fix works
update See pull request #46

@premchander
Copy link

We have tested it. It is not working.

@pietersv
Copy link

Sorry, I should have updated this discussion thread. Shortly afterward had submitted this pull request (#46) to write numbers as numbers.

You can use this branch, https://github.com/protobi/msexcel-builder. For a test, run mocha test/example.js which writes an output file to /tmp/example2.xlsx. This mocha test does't (yet) actually read the generated programatically to verify that. But if you open the file, you should see numbers as numbers, text as text.

@mattwilsn
Copy link
Author

msexcel-builder-colorfix-intfix

Here is an npm package that includes this fix as well as another known cell color issue. I am currently using this and it is working.

@premchander
Copy link

Thanks Pietersv and Mattwilsn for resolving my issue. Now its working fine.

@mattwilsn
But font color in msexcel-builder-colorfix-intfix is applying for the fonts in excel cell. Only background color is applying for cell.

How to apply font color for fonts in cell?

Thanks

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