Pivot tables refresh data issue

Hi,


I’ve encountered an issue while I was working with pivot tables.
I’ve attached my template and the result file.

As you can see, the template contains a pivot table with not refreshed data.

This is my code:

var wb = new Workbook(@“C:\Test\Template.xlsx”);
wb.Worksheets[0].PivotTables[0].RefreshData();
wb.Save(@“C:\Test\Output.pdf”, SaveFormat.Pdf);

As expectation in the resultant pdf file there should be the pivot table with the refreshed data
but the “Quarter X Over/Under” row isn’t calculated.

Thanks.

Hi,


Thanks for the template file and sample code.

After an initial test, I observed the issue as you mentioned. I found that PivotTable is not refreshed with data in the output PDF file. I used the simple lines of code with your template file. In the output PDF file, the rows labeled as “Quarter X Over/Under” are not calculated and are set to “0” value.
e.g
Sample code:

var wb = new Workbook(@“e:\test2\Template.xlsx”);
wb.Worksheets[0].PivotTables[0].RefreshData();
// I even tried this line but to no avail.
// wb.Worksheets[0].PivotTables[0].CalculateData();
wb.Save(@“e:\test2\out1.pdf”, SaveFormat.Pdf);

I have logged a ticket with an id “CELLSNET-44287” for your issue. We will look into it soon.

Once we have any update on it, we will let you know here.

Thank you.

@andreaghirardello,
Please try our latest version/fix: Aspose.Cells for .NET v21.6.3 (attached)
Aspose.Cells21.6.3 For .Net2_AuthenticodeSigned.Zip (5.5 MB)
Aspose.Cells21.6.3 For .Net4.0.Zip (5.5 MB)
Aspose.Cells21.6.3 For .NetStandard20.Zip (5.5 MB)

Your issue should be fixed in it.
Let us know your feedback.