Bug 142553 - Save CSV Cell Contents As Shown Ignored for Hidden/Zero-Height Rows/Columns
Summary: Save CSV Cell Contents As Shown Ignored for Hidden/Zero-Height Rows/Columns
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: CSV-Export
  Show dependency treegraph
 
Reported: 2021-05-29 07:30 UTC by flywire
Modified: 2022-05-02 13:38 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments
Demonstrates hidden rows and columns csv exported with cell content as shown (9.54 KB, application/vnd.oasis.opendocument.spreadsheet)
2021-05-29 07:30 UTC, flywire
Details

Note You need to log in before you can comment on or make changes to this bug.
Description flywire 2021-05-29 07:30:40 UTC
Created attachment 172431 [details]
Demonstrates hidden rows and columns csv exported with cell content as shown

Calc: File, Save as, Text CSV with Edit filter settings, Save cell content as shown, Quote all text cells saves hidden cells. It is expected Save cell content as shown should not save hidden or no-height rows and columns.
Comment 1 raal 2021-05-29 14:42:21 UTC
Look at help: https://help.libreoffice.org/7.2/en-US/text/shared/00/00000207.html?System=UNIX&DbPAR=CALC&HID=modules/scalc/ui/imoptdialog/fieldframe#bm_id3154839
Save cell content as shown
Enabled by default, data will be saved as displayed, including applied number formats. If this checkbox is not marked, raw data content will be saved, as in older versions of the software.

I think it's not a bug, the "Save cell content as shown" option is about formats of data, not about filtered rows.
Comment 3 flywire 2021-05-29 23:48:29 UTC
(In reply to raal from comment #1)
> Look at help:
> https://help.libreoffice.org/7.2/en-US/text/shared/00/00000207.
> html?System=UNIX&DbPAR=CALC&HID=modules/scalc/ui/imoptdialog/
> fieldframe#bm_id3154839
> Save cell content as shown
> Enabled by default, data will be saved as displayed, including applied
> number formats. If this checkbox is not marked, raw data content will be
> saved, as in older versions of the software.
> 
> I think it's not a bug, the "Save cell content as shown" option is about
> formats of data, not about filtered rows.

Disagree, given cell content is not shown because of the format is *exactly* why it is a bug. There is no other way for user to export data as shown without changing it or using macro, both unreasonable.

Agree current functionality is "Save data format as shown" rather than "Save cell content as shown" but the documented intention is clearly to "Save cell content as shown".

==========

Interesting raising filtering which was unintentionally included in example by filtering rows rather than hidden/zero-width rows.

Filtering is inconsistent too:

eg hide A2, zero height A4, filtering out A6, A8, A10

cut and paste

Col1	Col2	Col3	Col4
A1	B1	C1	D1
A2	B2	C2	D2
A3	B3	C3	D3
A4	B4	C4	D4
A5	B5	C5	D5
A7	B7	C7	D7
A9	B9	C9	D9


export as csv

"Col1","Col2","Col3","Col4"
"A1","B1","C1","D1"
"A2","B2","C2","D2"
"A3","B3","C3","D3"
"A4","B4","C4","D4"
"A5","B5","C5","D5"
"A6","B6","C6","D6"
"A7","B7","C7","D7"
"A8","B8","C8","D8"
"A9","B9","C9","D9"
"A10","B10","C10","D10"
Comment 4 Eike Rathke 2021-08-16 10:00:03 UTC
(In reply to flywire from comment #3)
> (In reply to raal from comment #1)
> > I think it's not a bug, the "Save cell content as shown" option is about
> > formats of data, not about filtered rows.
> 
> Disagree, given cell content is not shown because of the format is *exactly*
> why it is a bug.
I disagree, hiding columns/rows is not cell coontent display formatting. It'd be unpleasantly surprising if a *view* option would alter the document *content* without user intend.


> There is no other way for user to export data as shown
> without changing it or using macro, both unreasonable.
And that is why for this there should be an extra option like "Omit hidden/filtered rows and columns" or some such.
=> RFE
Comment 5 flywire 2021-08-16 11:19:45 UTC
(In reply to Eike Rathke from comment #4)
> (In reply to flywire from comment #3)

Agree, a view of data is the right approach. Looking at the cut-and-paste output in Comment 3:

- Hidden data is still in the dataset, just not shown (fix the terminology)
- Filtered data is not in the dataset, like a view of a data table (database query).

The "As formatted (and hidden)" data view (tab delineated) is *exactly* what cut-and-paste returns (see Comment 3). So should csv export (with comma) by default.

----------

BUG: csv export exports data the is not in the filtered view

----------

BUG: label "Save cell content as shown" doesn't reflect functionality

----------

No confirmation. Probably few are aware of the intricacies of this functionality, you never know what you are going to get. Examples below are default (no user-formatting applied):

*csv_demo1_as_shown.csv*

Date,Amount
25/12/95,1
01/01/21,1.1

*csv_demo1.csv*

Date,Amount
25/12/1995,1
01/01/2021,1.1