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

Empty cells with style aren't skipped anymore #8

Closed
wants to merge 1 commit into from

Conversation

azukaar
Copy link

@azukaar azukaar commented Aug 10, 2015

Fixing #7

@protobi
Copy link
Collaborator

protobi commented Aug 10, 2015

@azukaar Great catch, thanks!

The way the code is structured I'll make the change to the source file, which is located in bits/67_wsxml.js and that'll get compiled to ./xlsx.js.

Before I do that, can you send or describe a test case that I can use to (a) verify it fails now and (b) see it succeed after implementing? The comment suggests this was a feature that was dropped but I don't think I changed that function, so I just want to be careful to get it right.

@azukaar
Copy link
Author

azukaar commented Aug 11, 2015

@protobi
Sorry about the title may be the "anymore" might be misleading, I just meant that after the fix they aren't skipped anymore.
To test a fail case, simply create a file with obvious pattern :
image

Then open it and resave it using js-xlsx :

window.workbookTemplate = XLSX.read(e.target.result, {type:"binary" ,cellStyles : true, bookVBA : true});

Then

wbout = XLSX.write(window.workbookTemplate,
    bookType: 'xlsx'
    bookSST: false
    type: 'binary')
saveAs new Blob([  s2ab(wbout)  ], type: 'application/octet-stream'), "test.xlsx"

Finally reopen the result in Excel and it will be :
image

This is actually a real issue for a lot of Excel file, for exemple :
image

Here, those strokes will disappear no matter what, because the inset cell will always be empty even after the report will be filled.
Oh also, sorry about fixing the bad file, I wasn't quite confident about the structure of the project !

@protobi
Copy link
Collaborator

protobi commented Aug 11, 2015

@azukaar Very helpful. Your changes are made and addressed under issue #7

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

Successfully merging this pull request may close these issues.

2 participants