Bug 89961 - Spanned cells not handled when saving to CSV with "Fixed Column Width" setting
Summary: Spanned cells not handled when saving to CSV with "Fixed Column Width" setting
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.3.3.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL: https://help.libreoffice.org/Common/E...
Whiteboard:
Keywords:
Depends on:
Blocks: CSV-Column-Limitations
  Show dependency treegraph
 
Reported: 2015-03-12 01:29 UTC by Jim Avera
Modified: 2019-09-12 10:16 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Simple spreadsheet with spanned columns (17.32 KB, application/vnd.oasis.opendocument.spreadsheet)
2015-03-12 01:29 UTC, Jim Avera
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jim Avera 2015-03-12 01:29:49 UTC
Created attachment 114051 [details]
Simple spreadsheet with spanned columns

If a spreadsheet is saved in Text (CSV) format and the "Fixed Column Width" option is selected, the contents of the columns as they are shown on the screen are written to the file without delimiters, i.e. suitable for posting as plain ASCII to a blog, etc.

However spanned columns are truncated at the first column in the set.  The content is not allowed to flow into succeeding columns.

For example, if the spreadsheet contains this:

A1         B1         C1         D1         
Foo bar this spans    C2         D2         
A3         B3         Foo bar this spans

You get this when saving as fixed-column-width CSV:

A1         B1         C1         D1         
Foo bar thi           C2         D2         
A3         B3         Foo bar thi

STEPS TO REPRODUCE:

1. Load the attached test.ods
2. File->SaveAs...
3. Select Text CSV (.csv) from the format drop-down
4. Check the "Edit filter settings" checkbox
5. Click Save 
6. Check "Fixed Column Widt" in the Field options dialog, and finish

RESULTS: Spanned columns are truncated at the end of the first column in each span group

EXPECTED RESULTS: Spanned data can flow over all the cells in the span group
Comment 1 A (Andy) 2015-03-12 20:15:05 UTC
Reproducible with LO 4.4.1.2, Win 8.1.

But I am not sure whether this is really a bug -> I personally think this is no bug.  
If a text string is longer than the fixed column width, it will be truncated at the end (see also LO online help).  And if you export data as a CSV file then only the data is stored cell by cell in a text file without any formatting (e.g. merging cells is only a visual effect which would not be stored).  If there are cells merged together like in this case with cell A2 / B2 then the data/text will be stored in cell A2 and cell B2 will be empty.
Because the text in the merged cell A2 / B2 is too long for cell A2 with the fixed column width the end of the text is truncated.
Therefore, I personally would say this is no bug.
Comment 2 raal 2015-03-13 06:13:07 UTC
I can reproduce with  LO Version: 4.4.2.0.0+
Build ID: 3e3f0f5c3051ea982f8f753e0f3e51441e8f9496
TinderBox: Linux-rpm_deb-x86_64@46-TDF, Branch:libreoffice-4-4, Time: 2015-02-22_10:24:01

I agree with Andy, this is not a bug. But I see bug when I unmerge A2:B2 and C3:D3, and resize columns. Then export with fixed width  doesn't export text after ":", but it's another issue.
Comment 3 Robinson Tryon (qubit) 2015-05-06 19:25:43 UTC
(In reply to A (Andy) from comment #1)
> Reproducible with LO 4.4.1.2, Win 8.1.
> 
> But I am not sure whether this is really a bug -> I personally think this is
> no bug...

It seems to me like this is a limitation of the particular export format. I think this should be *documented* as such, perhaps with a warning about spanned cells loosing data when CSV export is attempted with the fixed-col-width option enabled.

Status -> NEW
Blocks: fixed-col-CSV-limits

Moggi: If you think this is just a Documentation issue, feel free to change the component. Thanks!
Comment 4 Robinson Tryon (qubit) 2015-05-06 19:50:50 UTC
(In reply to raal from comment #2)
> ...But I see bug when I unmerge A2:B2 and
> C3:D3, and resize columns. Then export with fixed width  doesn't export text
> after ":", but it's another issue.

Raal: Please file that as a separate issue, and link to this bug. Danke :-)
Comment 5 QA Administrators 2016-09-20 09:38:12 UTC Comment hidden (obsolete)
Comment 6 Timur 2019-09-12 10:16:27 UTC
(In reply to Robinson Tryon (qubit) from comment #3)
> It seems to me like this is a limitation of the particular export format. I
> think this should be *documented* as such, perhaps with a warning about
> spanned cells loosing data when CSV export is attempted with the
> fixed-col-width option enabled.
> 
> Status -> NEW

But, as already explained, Help says this at https://help.libreoffice.org/Common/Export_text_files.

So, while I reproduce this with 6.4+, this is NotABug but expected and documented behavior.