Free Support Forum - aspose.com

Pivot Chart Data Source fail to refresh

Hi,

We have this issue with Pivot Charts. When we rename the sheet using a name that contains quotes (’), it seems that it became impossible to refresh existing pivot charts. When we try to call the RefreshPivotData() function, an error is raised. We need to refresh them otherwise we will not see the updated data when we save the workbook to PDF. Please see the attached example.

Aspose_PivotChartIssue.zip (21.5 KB)

@andreagasparin,

Thanks for the sample project.

Could you also provide us template PivotChart.xlsx file, so we could evaluate your issue precisely soon.

Sorry, I forgot it PivotChart.zip (13.6 KB)

@andreagasparin,

Thanks for the template file.

After an initial test, I am able to observe the issue as you mentioned by using your sample code with your template file. I found an exception “Invalid formula:”‘New’ Name’!G11:G15"." when refreshing pivot chart data.
e.g
Sample code:

// Open the workbook 
            var workbook = new Workbook("e:\\test2\\PivotChart.xlsx"); 

            // Modify a cell in the original table 
            var cell = workbook.Worksheets[0].Cells[4, 3]; 
            cell.Value = 3; 

            // Rename the sheet using a name with ' 
            workbook.Worksheets[0].Name = "New' Name"; 

            // refresh pivot, this is done correclty 
            workbook.Worksheets[0].PivotTables[0].RefreshData(); 
            workbook.Worksheets[0].PivotTables[0].CalculateData(); 

            // We need this in order to obtain a refreshed pivot chart when we save it to PDF 
            Console.WriteLine(workbook.Worksheets[0].Charts[0].PivotSource);//New' Name!PivotTable1 - Ok 
            workbook.Worksheets[0].Charts[0].RefreshPivotData();//Exception 

            workbook.Save("e:\\test2\\PivotChart_After1.xlsx");

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

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

1 Like

@andreagasparin

Thanks for using Aspose APIs.

This is to inform you that we have fixed your issue CELLSNET-46097 now. We will soon provide the fix after performing QA and including other enhancements and fixes.

@andreagasparin

Thanks for using Aspose APIs.

Please download and try the following fix for your issue CELLSNET-46097 and let us know your feedback.

The issues you have found earlier (filed as CELLSNET-46097) have been fixed in this update. Please also check the document/article for your reference: https://docs.aspose.com/display/cellsnet/Installation