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: 2023-11-08 19:03 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


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
Comment 6 Mike Kaganski 2022-07-04 05:17:20 UTC
This thinking would naturally expand to "I have my column 3 cm, but the text in the column is not truncated on "save as shown"" reports. Clear notabug IMO.

I tried with MS Excel 2016, and I found no way to treat hidden cells as absent in CSV export, either.
Comment 7 Avery Freeman 2022-12-19 00:34:55 UTC
Saving .csv with data in order of the first row shown with hidden columns is why I've used Libreoffice for my work for the last 8 years. I just learned Libreoffice is not saving subsequent rows in the order of the first row anymore if columns are hidden.  This means several months of my work will need to be repaired to reflect subsequent rows be in the order of the first row.  For me, this a breaking change. I am searching for a pre-7.2 version of Libreoffice to install as a workaround. Very upset.
Comment 8 flywire 2023-02-26 21:17:23 UTC
(In reply to Mike Kaganski from comment #6)
> This thinking would naturally expand to "I have my column 3 cm, but the text
> in the column is not truncated on "save as shown"" reports. Clear notabug
> IMO.
> 
> I tried with MS Excel 2016, and I found no way to treat hidden cells as
> absent in CSV export, either.

I agree the functionality is similar to excel which is a good thing. To reiterate my two concerns:

1) "As shown" does not describe existing functionality. The words should be changed to better describe existing functionality.
2) This is so screwy people need to describe cells as visible (an equivalent word for shown): https://superuser.com/questions/476504/how-do-i-export-only-visible-cells-from-excel-to-csv/768689 where a LO extension is given. It seems wrong users need to copy the visible data to a sheet and then save it as csv rather than save directly with an option.
Comment 9 ace_dent 2023-11-08 14:05:05 UTC
I understand the debate, but clearly there is a real need for this functionality.
Please consider adding `Do not export hidden cells` as a tick box option.
Comment 10 flywire 2023-11-08 19:03:40 UTC
(In reply to ace_dent from comment #9)
> Please consider adding `Do not export hidden cells` as a tick box option.

I suggest:

1. "Save cell format as shown" actually describes existing functionality.
2. "Only export visible cells" is a more positive visual confirmation option than "Do not export hidden cells". It would exclude hidden or zero width rows or columns and rows that are filtered out.