we are using Aspose Cells to build custom pivots in our app. Due to another bug, we wanted to update to 24.X version, but we are not able to since our pivots use calculated fields and the latest version breaks drag & drop pivot functionality when calculated field is added and this is essential for our users.
Replication steps:
When using version 24.12 and running attached test, the result is that the working.xlsx Excel allows user to drag and drop fields in pivot view while the not_working.xlsx does not allow this
When using version 21.9, both tests produce pivot where drag & drop works just fine (I did not test interim versions)
I have dug a bit and this can be fixed manually (by deselecting and selecting the “Classic PivotTable layout” option in PivotTable Options in Excel and in the XML (by adding compact=“0” attribute on the calculated pivot field in pivotTable1.xml). Neither of those is something we want to do and I did not manage to influence the value of this via any code I could think of so I turn to you.
In the next post, I will attach the source code and example Excels.
I tested your scenario and tried both cases using your sample code snippets. I am sorry but I could not find any issue with the output “not_working.xlsx” file. In the pivot table (of the output file), I can drag and drop fields in MS Excel manually in Field List. Please find attached the output file and let me know on how could I reproduce and spot the issue. not_working.zip (10.7 KB)
You may also capture some screens to demonstrate the issue. This will help us to evaluate and reproduce the issue and consequently we can figure it out soon.
thanks for trying to reproduce the issue. I tried the output you uploaded and can reproduce the issue. The drag and drop does indeed work in the field list, but it does not work directly on the pivot.
In the working.xlsx, you can drag and drop the Product label from columns to rows or filter (indicated by the “moving cross” cursor when you hover over it. In the not-working one, you cannot do this, instead getting the standard “plus” cursor when you hover over it.
I have attached two short videos - a working one showing the drag and drop in action and not_working one showing the same approach on the broken pivot.
@jbures
By testing with sample code on the latest version v24.12, we can reproduce the issue. After adding some calculation fields to the pivot table, the drag and drop operation on the pivot table does not work.
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): CELLSJAVA-46206
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
If we add a pivot table in MS Excel newer version , the pivot table show as compact form by default.
So we did some improvement to add compact pivot table with the new method: public int Add(string sourceData, string cell, string tableName, bool useSameSource, bool isXlsClassic).
When isXlsClassic is true and add calculated field, we forgot to set compact as false.
We have fixed this issue. And we will include it into the next version 25.1 24.12.2.zip (10.6 KB)