Bug 54806 - Reading .xlsx format drops leading zeros of value dispite "text" cell format
Summary: Reading .xlsx format drops leading zeros of value dispite "text" cell format
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
3.6.2.2 release
Hardware: x86 (IA32) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-12 08:35 UTC by Timon
Modified: 2015-04-20 05:31 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
files in different formats and only .xlsx format truncates leading zeros (18.65 KB, application/x-zip-compressed)
2012-09-12 08:35 UTC, Timon
Details
xlsx file formatwith leading zeros disappearing (63.59 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2012-11-02 06:02 UTC, fox72
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Timon 2012-09-12 08:35:02 UTC
Created attachment 67025 [details]
files in different formats and only .xlsx format truncates leading zeros

We have a new speadsheet
Cell A1 has "text" format
We put any value in cell A1, for example, 10001643 and save document in Microsoft Excel 2007/2010 .xlsx file format (test 1.xlsx)
In second step we add two leading zeros to value in cell A1. Now we have value 0010001643 in cell A1. 
If we save document in Microsoft Excel 2007/2010 .xlsx file format, then after closing file and opening it again, we can see that value in A1 cell is 10001643 without the two leading zeros, despite that it must be 0010001643 (test 2.xlsx)
If we save document in any other format (Microsoft Excel 97/2000/XP/2003 .xls or .ods format - test 3.xls and test 4.ods), then after closing file and opening it again in cell A1 we can see correct value 0010001643.
Comment 1 Steve Romanow 2012-09-14 19:31:22 UTC
Should this be broadened from just xlsx writer to also import xlsx?

I have examples where test spreadsheet created in Excel 2010 with leading zeros intact is opened in LO 3.6.1 and the leading zeros are removed.  THis is reproducible on win7 64 bit as well as Ubuntu 12.04 (slightly older version of LO, machine is not with me.)
Comment 2 Steve Romanow 2012-09-14 19:35:55 UTC
It actually might be only "reader".  You cannot be sure of the state of the spreadsheet after saving and closing unless you unzip the xlsx and look at its SharedStrings.xml snippet.

This can be verified by Making your file in LO, saving it, then open it with Excel.
Comment 3 Timon 2012-09-14 20:24:48 UTC
Because "test 1.xlsx" was created and then modified in LibO and saved as... "test 2.xlsx" I tried to open "test 2.xlsx" with MS Excel 2003 SP3 with File Format Converters. Excel shows value in A1 cell 0010001643, LibO shows 10001643. So everything is verified.
Comment 4 Steve Romanow 2012-09-14 20:40:00 UTC
That does not show that the writer is failing.  If the LibO writer was failing, then excel would not have the leading zeros when it opened it.
Comment 5 Timon 2012-09-15 04:36:45 UTC
(In reply to comment #4)
> That does not show that the writer is failing.  If the LibO writer was failing,
> then excel would not have the leading zeros when it opened it.

That shows that file saved correctly, but LibO "reader" for some unknown reasons open file without leading zeros.
Comment 6 Steve Romanow 2012-09-17 21:17:45 UTC
I am looking at this qa page.

http://wiki.documentfoundation.org/Development/Calc_Import_Unit_Tests

This seems to be the correct place to address this issue.
Comment 7 fox72 2012-10-26 06:37:06 UTC
Confirm the presence of this bug for version 3.6.2.2. When you save a file in xls format disappear leading zeros. When you import this xls-file in Indesign publishing contents of the cell has no leading zeros
Comment 8 Steve Romanow 2012-10-26 11:50:10 UTC
Are you positive xls? This bug is about xlsx.   Xls appears to write ok with my tests.
Comment 9 fox72 2012-11-02 06:02:30 UTC
Created attachment 69413 [details]
xlsx file formatwith leading zeros disappearing
Comment 10 Timon 2013-01-14 06:19:53 UTC
Works for me in LibreOffice Version 4.0.0.1 (Build ID: 527dba6f6e0cfbbc71bd6e7b88a52699bb48799)
Don't know what's the problem with attachment 69413 [details]. In Libo 3.6.4.3 and 4.0.0.1 see no difference, but leading zeros are present.
Comment 11 Timon 2013-01-14 06:21:37 UTC
(In reply to comment #9)
> Created attachment 69413 [details]
> xlsx file formatwith leading zeros disappearing

Please, test your attachement with LibO 4.0.0 RC1. Seems all problems with leading zeros were fixed.
Comment 12 QA Administrators 2015-04-19 03:19:57 UTC
** Please read this message in its entirety before responding **

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

   *Test to see if the bug is still present on a currently supported version of LibreOffice (4.4.1 or later)
   https://www.libreoffice.org/download/

   *If the bug is present, please leave a comment that includes the version of LibreOffice and your operating system, and any changes you see in the bug behavior
 
   *If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a short comment that includes your version of LibreOffice and Operating System

Please DO NOT

   *Update the version field
   *Reply via email (please reply directly on the bug tracker)
   *Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case)


If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 

1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3)

http://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug 
3. Leave a comment with your results. 
4a. If the bug was present with 3.3 - set version to "inherited from OOo"; 
4b. If the bug was not present in 3.3 - add "regression" to keyword


Feel free to come ask questions or to say hello in our QA chat: http://webchat.freenode.net/?channels=libreoffice-qa

Thank you for your help!

-- The LibreOffice QA Team This NEW Message was generated on: 2015-04-18
Comment 13 Timon 2015-04-20 05:31:52 UTC
Seems all problems with leading zeros were fixed in LibreOffice 4.4.2.2 Build ID c4c7d32d0d49397cad38d62472b0bc8acff48dd6 Locale ru_RU on Windows XP Professional SP3 (32bit)