every xls and xlsx file when saved as .ods get corrupted. #649
Labels
No Label
DBF
Dates
Defined Names
Features
Formula
HTML
Images
Infrastructure
Integration
International
ODS
Operations
Performance
PivotTables
Pro
Protection
Read Bug
SSF
SYLK
Style
Write Bug
good first issue
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sheetjs/sheetjs#649
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Can you share the original file, the code that you used to convert, and the resulting ODS file?
I just checked using the sheetjs.xlsx file generated by the write test:
GH doesn't support the ODS extension, so remove the
.zip
extension to see:sheetjs.ods.zip -- the ODS file generated in the test (so this is "from scratch")
sheetjs.xlsx.ods.zip -- the ODS file generated by the command
xlsx -Y sheetjs.xlsx
(so this is reading an XLSX file and converting to ODS)I am using it in node.js
var xlsx = require('xlsx'); var workbook = xlsx.readFile('sample.xlsx'); xlsx.writeFile(workbook, 'out.ods');
In office the file get opened after repairing it. But i want it to be displayed in browser using viewerjs http://viewerjs.org/
When i convert sample.xlsx using Microsoft Office it get show no warning in MS and also opens up in browser but when i convert sample.xlsx using this library it show error in MS and also do'nt show up in viewerjs
My basic aim is to convert xlsx to ods and then display it in browser.
LibreOffice opens the files without warning, which suggests the generated files are valid. Ask the viewerjs.org people about why they can't display the files.
As for Excel, based on the error messages it looks like Excel requires certain fields that are technically optional according to the OpenDocument specifications. The Windows versions won't show you any error messages, but the Mac versions of Excel generate conversion logs with messages like:
On a lark, we tried pulling the missing parts (styles as well as metadata) from an Excel 2013 ODS file and Excel 2013/2016 read the file without warning. Here's a sample (rename the .zip to .ods):
sheetjs.zip
This will be added to the next version
Thanks Can you tell when will this be pushed to git?
@WaqasJaved1 we just pushed to the repo. Based on our tests, Excel will fail on ODS files without styles.xml, so we now add a stub. As Excel and LibreOffice both open the files, we can assert that any issues with third-party readers reflect bugs with those tools rather than corruption in the generation process.
@SheetJSDev Thanks for quick response. I have tried updated new version. The converted file you sent me open successfully in viewer and also in MS. But when i convert my files from this library it is still showing error on MS 2016 and also not opening in viewer.
I am using following code to convert
var xlsx=require('xlsx'); var workbook = xlsx.readFile('sample.xlsx'); xlsx.writeFile(workbook, 'out.ods');
sample.xlsx
out.ods.zip
@WaqasJaved1 We updated the git repo but have not bumped the version or published to NPM. Give us about an hour to make sure all of the tests pass, then we'll push 0.10.1.
@WaqasJaved1 we just pushed 0.10.1 to npm, update your local version with
npm install xlsx
and try again.@SheetJSDev very professional work.
I have tried and it works fine now.
There is no text decoration in converted file. In future are you guys planning to do that part?