Bug 32672 - CALC: DBF-Fields with zero decimals wrong detected (filter ignores numeric format header information)
Summary: CALC: DBF-Fields with zero decimals wrong detected (filter ignores numeric fo...
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
3.3.0 release
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:3.5
Keywords:
: 47496 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-12-26 18:05 UTC by mhonline
Modified: 2017-06-17 11:33 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
N,19,0 becomes N,7,2 (124.97 KB, image/jpeg)
2011-05-18 17:49 UTC, mhonline
Details
ZIP with DBFtest in different flavours (Original, LO-Changed and LO-manual-set) (929 bytes, application/zip)
2014-07-07 17:19 UTC, mhonline
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mhonline 2010-12-26 18:05:57 UTC
I am not sure about that, but up to my knowledge a 
Label,N
needs to be treated as having ZERO decimals

Note: Zero-decimals is the standard format for counters in DBase-files.
The counter is brooken and Calc is destroying data, when it is treated as STANDARD (and thusby falsy added a ,00)


Note: an Label,N,8,0 seems to work perfect, but thats not the case.

Martin
Comment 1 Jan Holesovsky 2010-12-28 05:56:50 UTC
Kohei, what do you think, please?
Comment 2 mhonline 2011-04-22 11:49:15 UTC
I am going to put this on ther list of the most-annoying bugs
Still no chance to use DBF as data-exchange-files (in LO and OOO too),
as LO falsy justifies left-to-right and adds decimal delimiter in N0-fields,
which means dataloss. not really a regression, as it never worked (what a pitty).

Martin
Comment 3 Kohei Yoshida 2011-05-11 12:48:37 UTC
Please attach a representative dbf document that you typically work with. Dbf has many variants.  I just want to know which version we are dealing with here.
Comment 4 Kohei Yoshida 2011-05-11 12:49:39 UTC
This cannot be a blocker for 3.4 since "this never worked" (as you say).
Comment 5 Kohei Yoshida 2011-05-11 12:53:06 UTC
A good place to start researching on dbf file format.

http://en.wikipedia.org/wiki/DBase#File_formats

There are several external links to (vary rare) dbf file format specification of some versions of dbf, but not all versions.
Comment 6 mhonline 2011-05-18 17:49:56 UTC
Created attachment 46879 [details]
N,19,0 becomes N,7,2
Comment 7 mhonline 2011-05-18 17:52:14 UTC
Did I mention, that this is funny arguing? 

You need to have a DBF-application - reopen the wrong-formed DBF in OOO/LO
works fine However: still worthless in 3.4 Beta 5

Look at attached screencaptures:
zaehler,N,19,0 (that is correct) - becomes
zaehler,N,7,2 (wow!)

Now the digits are justified correct (right to left) , but inserts a decimal+00
and changes the format

Fun: it shortens the fieldlength and makes it dynamic - in regard to the
longest number in that column. I do not know, whether this will have any effect
when reopen in real DBF-applications, lets see. that happens on decimals only,
not on text-fields.

Martin
Comment 8 Sergey Naumov 2012-02-02 11:40:40 UTC
Don't know whether my problem relates to this one, but I have .ods document opened with LO Calc, and when I am entering to a pre-print mode, trying to print it or export to PDF, then all zeros disappear. This looks like if we apply decimal format with no leading zeros to all cells where numbers reside. Switcing to text format of cells does not help.

I use LO 2.4.5
Comment 9 Sergey Naumov 2012-02-02 11:41:25 UTC Comment hidden (obsolete)
Comment 10 Sergey Naumov 2012-02-02 11:42:41 UTC Comment hidden (obsolete)
Comment 11 Sergey Naumov 2012-02-02 11:43:02 UTC
Don't know whether my problem relates to this one, but I have .ods document
opened with LO Calc, and when I am entering to a pre-print mode, trying to
print it or export to PDF, then all zeros disappear. This looks like if we
apply decimal format with no leading zeros to all cells where numbers reside.
Switcing to text format of cells does not help.

I use LO 2.4.5
Comment 12 Kohei Yoshida 2012-02-02 11:53:02 UTC
Stop spamming bugzilla please.  And this is not a user forum.
Comment 13 Gerhard Müllner 2013-07-11 09:22:32 UTC
the same problem with version 3.6 (linux) 4.0.4.2 (windows)
dBase export filter seems to ignore numeric format header information e.g ?,N,0, or tries to optimize/modify format header.
this behavior is very bad.
if there is a header information available, then dbase export filter must use this information, without any changes.
Comment 14 Kohei Yoshida 2013-07-11 15:15:43 UTC
Don't assign anything to me please.
Comment 15 bfoman (inactive) 2013-07-26 10:06:32 UTC
Please do not change the version field as it indicates the earliest version where bug is present. Changed back to 3.3.0 value (as original is no more available).
Comment 16 mhonline 2014-07-07 17:19:30 UTC
Created attachment 102382 [details]
ZIP with DBFtest in different flavours (Original, LO-Changed and LO-manual-set)
Comment 17 mhonline 2014-07-08 00:53:23 UTC
for a reason i do not know, the last comment is not visible, so
a short repeat:

1. LO still does not detect "Fieldname,N,19,0" (similar to "integer" and used for counters) on opening dbf-file, 
a construct like this will always be opened like "Fieldname,N,19,2" (decimal with two digits)

2. DBF-file will never be reused but always overwriten with a new DBF, but that is well formed accordingly to the header-settings
(This is better than in the past, when wrong formed records had been added to the file with the result of corrupting the DBF-File)

3. The settings in the header will be treated right, so manually set the header to "Fieldname,N,7,0" will save the file accordingly (works for dbf-reading applications). However, when reopening that file in LO, LO will treat this file wrong again (see item 1.)

Better than nothing, so at least the Help-File needs to contain an advice how DBF-numericals can be saved without decimals

mh

LO 4.2.4 on Win7
Comment 18 QA Administrators 2016-02-21 08:37:54 UTC Comment hidden (obsolete)
Comment 19 mhonline 2016-02-23 11:30:50 UTC
No, that issues seems to be solved - tested on LO 510 with clean dbf on import to calc and exported from calc to dbf, everything seems to work fine.
thanks.
mh
Comment 20 Joel Madero 2016-07-04 07:11:13 UTC
With final comment closing this as WFM. Thanks for the update!
Comment 21 Julien Nabet 2017-06-17 11:33:25 UTC
*** Bug 47496 has been marked as a duplicate of this bug. ***