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.
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.
See also https://ask.libreoffice.org/en/question/311625/save-calc-csv-as-displayed-ignoring-hidden-rows-and-columns/
(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"
(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
(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
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.
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.
(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.
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.
(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.
(In reply to flywire from comment #10) > 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. This would be the best. Hidden cells are not “shown”, so it’s misleading. Clear renaming would improve the situation. An option to only save visible would be useful, of course. It may be simpler to ignore hidden, but since neither is visible at all, they are indistinguishable. It’s better to err on the side of WYSIWYG rather than frustratingly opaque behaviour.