This causes an exception in my sample sheet - with 24.5 it did not happen:
Aspose.Cells.CellsException
HResult=0x80131600
Message=Formula is empty.(Based on PivotCalculatedItem[])
Source=Aspose.Cells
StackTrace:
at ????.?(StringBuilder ?)
at ????.?(Int32 ?, String ?)
at ????.???????(???? ?)
at ????.?(PivotTableRefreshOption ?, ???? ?, Boolean ?)
at ????.?(Boolean ?, Boolean ?, PivotTableRefreshOption ?)
at AsposeCellsPivot.Form1.button1_Click(Object sender, EventArgs e) in C:\Temp\AsposeCellsPivot\Form1.cs:line 32
I drilled it down to a value “Formel1” (translates to “Formula1”), which is found in the value list of the field “Personalnummer”, as shown in the left part of the screenshot. formel1.png (66.6 KB)
This “Formel1” can be found in “Fields, Items & Sets”, item “Calculated Item”, and there I can delete it (right part of my screenshot).
An english screenshot of this part of the menu is found at https://www.exceldemy.com/wp-content/uploads/2022/01/7.-Calculated-Field-in-Pivot-Table.png
I don’t know the purpose of “Formel1”, it might exist since ages in the excel sheet. So it might be an old error.
My questions:
a) why does excel not report any error when calculating the table, but Aspose.Cells does? If you report an error: could you improve the error message to point to the culprit?
b) how can I access those “Calculated items” with Aspose.Cells" API? I just want to check how the item looks like - and maybe I could create cleanup code, as we probably have a bunch of templates created from the same ancestor.
Thanks for the sample Excel file and code snippet with details.
After an initial test, I was able to reproduce the issue as you mentioned by using your template XLSX file. I found an exception ‘Formula is empty.(Based on PivotCalculatedItem[])’ when refreshing pivot table.
We require thorough evaluation of the issue. We will then evaluate and clarify your queries (at the bottom). 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): CELLSNET-56029
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.
@wknauf
The fix will be included in our upcoming release (Aspose.Cells v24.7) which is due in the second week of July this month. You will be notified when the next version is released.
@John.He Thanks! Do you have any details on the issue? Was this an error (invalid formula) in our excel file that is somehow “ignored” with the new Aspose.Cells version? Or was it a bug on your side?
@wknauf
There is a strange calculated item “Formel1” in the pivot field “Personalnummer”.
The formula of “Formel1” is empty.
The empty formula of calculated item caused this exception.
But it’s strange that it’s filtered again, so it’s completely redundant.
The issues you have found earlier (filed as CELLSNET-56029) have been fixed in this update. This message was posted using Bugs notification tool by johnson.shi
Thank you for your feedback, and it’s good to know that your issue has been resolved by the new version. Please feel free to write back to us if you have any further queries or comments.