Exception when reading pivot table data source

We have the following test file: PivotTableError.xlsx.zip (99.4 KB)

And the following test code:

var workbook = new Workbook("PivotTableError.xlsx");

var pivotTable = workbook.Worksheets[0].PivotTables[0];
var dataSource = pivotTable.DataSource; // throws exception

For some reason this generates a System.NullReferenceException: ‘Object reference not set to an instance of an object.’ Can you investigate this error and provide a fix?

We’re using the latest Aspose.Cells v25.2.0 for .NET. Thank you!

@perfectxl,

Thanks for the template Excel file.

After initial testing, I am able to reproduce the issue as you mentioned by using your template Excel file and sample code snippet. I found “System.NullReferenceException” when retrieving data source for the pivot table. I also found since the data source for the pivot table is external connections/queries, which might not be retrieved by the Aspose.Cells.

We require thorough evaluation of the issue. 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-57890

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.

@perfectxl
We are pleased to inform you that your issue (logged earlier as “CELLSNET-57890”) has been resolved. The fix/enhancement will be included in the next release (Aspose.Cells v25.3) scheduled for release first half of March (next month). You will be notified when the next version is published.

The issues you have found earlier (filed as CELLSNET-57890) have been fixed in this update. This message was posted using Bugs notification tool by leoluo