test excel file.zip (9.8 KB)
The attached excel file contains a pivot table with a date field that is grouped by year and month. This works fine in Excel, but causes an exception in code when attempting to refresh. This occurs with the latest 17.8 release of Aspose.Cells for .NET.
The exception that is being thrown is System.FormatException. It also says “Input string was not in a correct format”. I believe it may have to do with the PivotItems that get created for the field such as “>2017”
Dim excel As New Aspose.Cells.Workbook("c:\temp\test.xlsx") Dim sheet As Aspose.Cells.Worksheet = excel.Worksheets(0) Dim pivot As Aspose.Cells.Pivot.PivotTable = sheet.PivotTables(0) pivot.RefreshData() 'this works pivot.CalculateData() 'this doesn't work sheet.RefreshPivotTables() 'this also doesn't work