Download it now!
Bug 130020 - No warning displayed even if error/warning code was set when spreadsheet data fails to save to dBASE format.
Summary: No warning displayed even if error/warning code was set when spreadsheet data...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.3 all versions
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.0.0 target:6.4.1
Keywords:
: 130019 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-01-15 17:16 UTC by Athos
Modified: 2020-02-04 06:27 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
screenshots (215.04 KB, image/png)
2020-01-15 17:20 UTC, Athos
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Athos 2020-01-15 17:16:36 UTC
Description:
CALC spreadsheet failed to save to dBASE format.
If the second row of a given column contains only numbers, it is incorrectly saved.
In this case, you treat the column as a number type and place a zero in the character type cell.
Screenshots link: prnt.sc  qo5h99
https://prnt.sc/qo5h99

Steps to Reproduce:
1. FILE / Save as / dBASE (*.dbf) type ( valami.dbf )
2. Just Use dBASE formatum
3. Export dBASE format: (DOS/OS2-852)
4. Click OK.
5. Close file
6. Open last document  ( valami.dbf )


Actual Results:
Zero digits appear in the character cell

Expected Results:
You should have saved the original content.


Reproducible: Always


User Profile Reset: No



Additional Info:
This error is present in all versions.
Comment 1 Athos 2020-01-15 17:20:00 UTC
Created attachment 157164 [details]
screenshots
Comment 2 Eike Rathke 2020-01-15 17:53:07 UTC
*** Bug 130019 has been marked as a duplicate of this bug. ***
Comment 3 Eike Rathke 2020-01-15 18:12:26 UTC
You can't have columns of mixed types in dBase. If the first data row's cell has numeric content then numeric/Decimal type is assumed, similar for boolean/Logical and Date. However, you can force a field to type Text/Character by appending ",C" (without quotes) to the field name, so in your case that would be "CODE1,C". Then numeric cell content is converted to text for export.

All columns' data could be scanned whether they contain mixed types and then switch to Character type, but.. that's rather a data layout error.
Comment 4 Eike Rathke 2020-01-15 18:40:14 UTC
ScDocShell::DBaseExport() for this case even sets SCWARN_EXPORT_DATALOST error code, but for some yet unknown reason a message is not displayed or the error not propagated later.
Comment 5 Eike Rathke 2020-01-16 14:34:01 UTC
At least since 5.3 (don't have earlier versions at hand).
Comment 6 Athos 2020-01-16 15:15:10 UTC
(In reply to Eike Rathke from comment #3)
> You can't have columns of mixed types in dBase. If the first data row's cell
> has numeric content then numeric/Decimal type is assumed, similar for
> boolean/Logical and Date. However, you can force a field to type
> Text/Character by appending ",C" (without quotes) to the field name, so in
> your case that would be "CODE1,C". Then numeric cell content is converted to
> text for export.
> 
> All columns' data could be scanned whether they contain mixed types and then
> switch to Character type, but.. that's rather a data layout error.

The ",C" post-field-name addition is not a bad idea, but doing hundreds or 1000 columns is a big job.
It would be better if you took the dBASE data field type from the table column type.
Comment 7 Eike Rathke 2020-01-20 15:02:56 UTC
There is no such thing as a "table column type" in a spreadsheet.
Comment 8 Commit Notification 2020-01-20 23:25:41 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/6a308d2bfaf1d756aa4cfca6a40b80cf5e88e5fa

Propagate warning error code from dBASE export, tdf#130020

It will be available in 6.5.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 9 Commit Notification 2020-02-04 06:27:22 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-6-4":

https://git.libreoffice.org/core/commit/02ca7b1c92a801004a42c92c59f4bbfc70ec19eb

Propagate warning error code from dBASE export, tdf#130020

It will be available in 6.4.1.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.