ODS : Unsupported value type 'error' #548
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#548
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
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?
Hi
following the #546 issue resolution, i confirm that the second exposed case
undefined
is solvednevertheless, the first problem
error
remainshacking
ods.js:329
asshow no more problem
Would it be possible to add this in a future
xlsx
version ?@lgodard thanks for following up! I tried to reproduce the issue in Excel 2016 by setting the cell A1 to
=0/0
, which generates a#DIV/0!
error in Excel, and saving to OpenDocument Spreadsheet. This actually works as expected, and the file works well.As it turns out, Excel does something bizarre here. It is actually generating a float value rather than an error value, which explains why the error wouldn't have been tripped. The error can be reproduced by following the same procedure in LibreOffice.
I have a rough sense for what needs to be fixed, but we need to enumerate the errors and make sure that LO is consistent.
Hi,
Thanks a lot for your interrest
i think the main ods problem for
error
is in parsing and namespaces; I do not think it is related to any legal error calculationlooking at the xml that leads to an error type
one can see 2
value-type
definitions :office:value-type="string"
andcalcext:value-type="error"
the parser returns second one
IIUC,
calcext:
namespace comes from libreoffice as a future opendocument official evolution, but strictly speaking, out of the scope of odf 1.2 norm versionSo, there is 2 possibilities
error
as a legalvalue-type
(less intrusive code as proposed)calcext
namespace (more intrusive, maybe side effects)calcext
namespace (same as current behaviour)one can step progressively on them
I'll try to build an ods file that reproduces the
calcext:error
problem, but can't promise i'll succeedBtw, thanks a lot for your response and feel free to ask if any help/test needed
Laurent
oups, not intended to close
Thanks again for digging further! The more interesting question is "what is the right way to handle this cell?", and it's really not clear.
A) Treat it as a string cell (
t='s'
). In the parlance of the OASIS spec, LO generates an extended OpenDocument, so it is perfectly acceptable to ignore thecalcext
hints. But it seems like a waste.B) Optimistically treat it as an error cell (
t='e'
) and map back to Excel error codes or generate fake error code values for LO errors that have no Excel equivalent. This is great for reading, but it is unclear how to serialize errors that have no equivalent in Excel.On a side note: it's unfortunate that
office:value-type
itself doesn't support error values, especially since Excel treats errors as a special value type.As a first shot, i would stick to A) and not try to make any guess on what the odf xml gives itself
reading the offending xml
one can see that
table:formula
is not a supported formatcode_:pj
is a named range but contains a:
character which is not valid in LibreOffice for a long time (but was legal in the past)i guess that the libreoffice team decided to keep the formula as given by the xml but deactived by the
calcext
namespaceMy understanding of this
calcext:value-type="error"
isI'm actually trying to build a simpler file for unit testing. I let you know
regarding your error values, feel free to ask any ods file that would help you
Laurent
Hi again,
Here is a simplified file that reproduces the problem
I was half-wrong (so half-right ;-) ) on the interpretation
The formula marked in yellow in the file is the problem
it is invalid (marked as #NAME in libreoffice) but it was intended as this sheet is used as templating (and the formula programmatically modified in libreoffice)
So, one can do A) and maybe B) considering that any calcext error leads to a #NAME error but that may be implementation-dependant. (so i still would stick to A) )
If needed i can search in libreoffice source code if you need some details on the #NAME error building and give you code pointers (but i do not think it is needed)
warning : rename it removing .zip extension
calcext_error_NAME.ods.zip
The error message is actually localized in the file:
I'm convinced that A) is better. We're hoping to make another push sometime this month or early March.
great !!!!
once solved, i'll can use xlsx deeply :)
thanks again
@SheetJSDev anything I can do to help finalizing this issue ?
@lgodard there are 3 types of "extensions" based on my experimentation:
loext
ooext
andcalcext
. They can be reproduced by saving files in open office and libre office either in the ODS format or the Flat ODS format. It is sufficient to reject any parameter override with namespace ending inext
.The fix, which should be going in sometime by the end of the week, is to change the else clause of the parsexmltag function in ods.js as follows:
guy, you rock !