Bug 126557 - Calc refresh of pivot table overwrites formatting and no undo
Summary: Calc refresh of pivot table overwrites formatting and no undo
Status: RESOLVED DUPLICATE of bug 41645
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Pivot-Table
  Show dependency treegraph
 
Reported: 2019-07-26 07:07 UTC by Phil
Modified: 2021-12-22 09:25 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
test case (14.76 KB, application/vnd.oasis.opendocument.spreadsheet)
2019-07-26 07:13 UTC, Phil
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Phil 2019-07-26 07:07:53 UTC
Description:
pivot table refresh causes:
1/ no undo
2/ formatting loss

Steps to Reproduce:
1. Open the attached "LO63 Calc pivot table formating bugs.ods"
2. Go on the tab "Pivot table BUG and ANNOYANCES"
3. Right-click on cell A1 to select the "refresh".
Observe the loss of all formatings
4. On the standard toolbar observe that there is no undo.
To verify it, CTRL+Z.

Actual Results:
1. formatting loss
2. no undo

Expected Results:
1. Refresh ought to keep the formatting of the pivot table.
2. Undo ought to be possible


Reproducible: Always


User Profile Reset: No


OpenGL enabled: Yes

Additional Info:
Comment 1 Phil 2019-07-26 07:13:07 UTC
Created attachment 152995 [details]
test case

Bug also if on XLSX format.

Possibly general bug such as 123225 ; 122472

In current LO 6.3 release notes, it is reported that Mike Kaganski, Collabora fixed already some pivot table bugs
Comment 2 Phil 2019-07-26 07:35:22 UTC
Additionnal point of attention:
Not only the refresh produces:
1/ The loss of cell formatting
2/ the unability to do undo

But also
the conditionnal formating is lost, which was applied to the pivot table.

To observe it.
1/ Go on the tab "Pivot table BUG and ANNOYANCES"
2/ select column B
3 Go to Format>Conditional Formatting > Manage
(https://help.libreoffice.org/Calc/Conditional_Formatting)
You'll noticed that the conditional formatting is still PRESENT, but no more applied.
Comment 3 Phil 2019-07-26 08:16:09 UTC
In the light that this appear:
1/ independently of the file format (ods, xlsx or even if not saved, you can create a new document if the same state)
2/ there is no undo

I suspect that the REFRESH actually calls a new constructor and NOT an UPDATE functions which must update the data content and leave the pivot table formatting as such, aka its css.
Probably the update function is not coded at all.

P.S. I reproduced the same conditions in MS-Excel 2000 (yes 2000), a pivot table refresh is indeed a data update and keeps the formatting.
Comment 4 Oliver Brinzing 2019-07-26 12:24:50 UTC
confirming.

btw: pivot table creates several cell styles starting with "Pivot Table ...". 
it will work, if you use these styles for formating.
Comment 5 m_a_riosv 2019-07-26 22:08:10 UTC
Maybe the no undo can be a bug, but not that pivot table styles are applied con it's updated, this way it's how it works. As Oliver point same approximation can be done modifying pivot table styles.

But seems the last solution it's broken e.g. modifying color background for a pivot table style works, but not number format that it's inherited from source cells. (LibreOffice 3.5.7.2 )
The last it's a regression from LibreOffice 3.3.0
Comment 6 Phil 2019-07-28 11:21:34 UTC
If you say it is not a bug, then I say the function is can not be called "refresh".

It's merely as calling a new constructor pivot table function with
A. parameters being the formely selected source area
B. dumping into the already target area sheet
C. and overwriting any styling in the target.

This is not the behaviour, as I mentionned in MS-Office, where a refresh is  bound to a data update.

>inherited from source cells.
If you inherit from source cells, that you ought to inherit it's type, that's why for instance in my example I put one line as Header1 style, which is LO63rc2 does not do.

Regarding inheritance of the source cells styling:

1/ ought to be an OPTION (for instance a thicker box), as it is not the default and expected behaviour when aggregating data.

2/ "refresh" behaviour ought to be consistent with other functions such as data filtering, sorting, etc.

>Maybe the no undo can be a bug
There is no undo, presumably because current coding flushes everything and so no undo is kept in the pile.

Whether inheriting the source cells or keeping the existing styling, the currently implemented "refresh" functions seems either to lack in its calling arguments the styling and/or in its body it wipes out all styling.
Comment 7 BogdanB 2020-05-30 13:44:25 UTC
*** Bug 133520 has been marked as a duplicate of this bug. ***
Comment 8 BogdanB 2020-05-30 13:47:31 UTC
It's a very annoyng bug, see video on bug 133520 (duplicate).

I want certain style for my tables. Maybe the boss tell you: I want that background here, that style here... And after changing one little ting everything is lost. The role of pivot table it's lost - it's a easy way to analyze and print data. But with loosing formating it's a long way in analyzing and printing data...
Comment 9 Stéphane Guillou (stragu) 2021-12-08 13:45:33 UTC
Marking as duplicate of bug 41645

*** This bug has been marked as a duplicate of bug 41645 ***
Comment 10 Phil 2021-12-22 09:25:31 UTC
I just posted on bug 41645

That if my bug report is marked as duplicate of bug 41645

Notably, the bug 41645 does not mention the impossible undo.