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

ODS documents look kinda broken #289

Open
rorp24 opened this issue Jul 7, 2020 · 0 comments
Open

ODS documents look kinda broken #289

rorp24 opened this issue Jul 7, 2020 · 0 comments

Comments

@rorp24
Copy link

rorp24 commented Jul 7, 2020

I have some troubles using viewerJS with ODS documents. The document look kinda broken. Even if I understand as a developper what is going on, my users won't like that.

image

the original version of the ODS:

image

I find a way to show the data, with SheetJS, but I think it is sad that a library that is not supposed to work with ODS documents work better than a library that is supposed to work with those documents

rendered html with SheetJS:

image

used code with SheetJS:
var request = new XMLHttpRequest(); request.open('GET', uri, true); request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); request.responseType = 'blob'; request.onload = function(e) { if (this.status === 200) { var blob = this.response; blob.arrayBuffer().then(res=>{ var workbook = XLSX.read(res, { type: "array" }); var worksheet = workbook.Sheets[workbook.SheetNames[0]]; $('.showView div').html(XLSX.utils.sheet_to_html(worksheet)); }); } }; request.send();

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

1 participant