Exception on PivotTable RefreshData

I am using Cells v7.2.0.4

After the basic generation of a report with data from our database, I am attempting to add pivot fields to some already existing pivot tables. However, I need to refresh the pivot tables before I do this, or the field names will be outdated (and cause another crash).

The attached file is a generated report BEFORE we do the adding of fields. I am trying run a basic refresh loop:

foreach (Worksheet sht in m_currentWorkbook.Worksheets)
{
foreach (PivotTable pt in sht.PivotTables)
{
pt.CalculateData();
pt.RefreshData();
}
}


and the following exception is thrown:

System.ArgumentException: this name or range is not supported.

Hi,

Thanks for using Aspose.Cells for .NET.

I was able to replicate this issue using your code with the latest version:
Aspose.Cells
for .NET v7.2.0.
4


I got the following exception.

We have logged this issue in our database. Development team will look into this issue and fix the problem.

Once the issue is fixed or we have some other update available, we will let you know asap.

This issue has been logged as CELLSNET-40635.

C#


string filePath = @“F:\Shak-Data-RW\Downloads\test.xlsx”;

Workbook m_currentWorkbook = new Workbook(filePath);

foreach (Worksheet sht in m_currentWorkbook.Worksheets)
{
foreach (PivotTable pt in sht.PivotTables)
{
pt.CalculateData();
pt.RefreshData();
}
}

m_currentWorkbook.Save(filePath + “.out.xlsx”, SaveFormat.Xlsx);



Exception:
System.ArgumentException was unhandled
Message=“this name or range is not supported.”
Source=“Aspose.Cells”
StackTrace:
at Aspose.Cells.Pivot.PivotTable.RefreshData()

Hi

We have fixed this issue.

Please download and try the fix: Aspose.Cells for .NET v7.2.0.7

The issues you have found earlier (filed as CELLSNET-40635) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.