Update xlsx.js #584

Closed
CRYP70N1C4 wants to merge 0 commits from master into master
CRYP70N1C4 commented 2017-03-07 12:23:46 +00:00 (Migrated from github.com)

write file whit bookSST true, it goes wrong,this can fix it.

write file whit bookSST true, it goes wrong,this can fix it.
coveralls commented 2017-03-07 16:53:21 +00:00 (Migrated from github.com)

Coverage Status

Changes Unknown when pulling a8ecd1e6d5 on LieJiang:master into ** on SheetJS:master**.

[![Coverage Status](https://coveralls.io/builds/10474121/badge)](https://coveralls.io/builds/10474121) Changes Unknown when pulling **a8ecd1e6d51d1b1a5b63e063b28dfe01e54112b7 on LieJiang:master** into ** on SheetJS:master**.
SheetJSDev commented 2017-03-08 07:58:55 +00:00 (Migrated from github.com)

@LieJiang If the value is undefined it is most likely a stub cell. The cell shouldn't be written in the first place.

Check your email

@LieJiang If the value is undefined it is most likely a stub cell. The cell shouldn't be written in the first place. Check your email
CRYP70N1C4 commented 2017-03-08 08:03:55 +00:00 (Migrated from github.com)

If the conversion type is not enforced, it does not work with 'do not have the match function'

If the conversion type is not enforced, it does not work with 'do not have the match function'
SheetJSDev commented 2017-03-08 08:14:43 +00:00 (Migrated from github.com)

@LieJiang I understand :) What I am saying is that the error is coming because of a bad cell. For example:

XLSX.write({SheetNames:["Sheet1"], Sheets:{Sheet1:{"!ref":"A1:A1", A1:{t:"s", v:3}}}},{bookType:'xlsx', bookSST:true, type:'buffer'});
XLSX.write({SheetNames:["Sheet1"], Sheets:{Sheet1:{"!ref":"A1:A1", A1:{t:"s", v:null}}}},{bookType:'xlsx', bookSST:true, type:'buffer'});

In the first case, the cell is a string cell with a numeric value. In this case, String will do the right thing, writing the text "3" to the cell.

In the second case, the cell is a string
cell with a null value. If you use the String conversion, the output file will have the text null in those cells. That is incorrect. If the text is null it should not write the data in the first place.

This will require a few more changes to other parts of the code. Keep the PR open

@LieJiang I understand :) What I am saying is that the error is coming because of a bad cell. For example: ```js XLSX.write({SheetNames:["Sheet1"], Sheets:{Sheet1:{"!ref":"A1:A1", A1:{t:"s", v:3}}}},{bookType:'xlsx', bookSST:true, type:'buffer'}); XLSX.write({SheetNames:["Sheet1"], Sheets:{Sheet1:{"!ref":"A1:A1", A1:{t:"s", v:null}}}},{bookType:'xlsx', bookSST:true, type:'buffer'}); ``` In the first case, the cell is a string cell with a numeric value. In this case, String will do the right thing, writing the text "3" to the cell. In the second case, the cell is a string cell with a null value. If you use the `String` conversion, the output file will have the text `null` in those cells. That is incorrect. If the text is null it should not write the data in the first place. This will require a few more changes to other parts of the code. Keep the PR open
CRYP70N1C4 commented 2017-03-08 08:41:12 +00:00 (Migrated from github.com)

We can add a filter before writing a file.

We can add a filter before writing a file.

Pull request closed

Sign in to join this conversation.
No description provided.