Percentage data not being showing up

I am seeing percentage data not being showing up but when I click OK button after clicking pivot selection button, it shows up correct percentage data . Please look into it.

code;

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

foreach (Worksheet sheet in workbook.Worksheets)

{

foreach (PivotTable pt in sheet.PivotTables)

{

pt.RefreshData();

pt.CalculateData();

}

}

workbook.Save("result.xlsx");

Sample file is attached

Hi,

Thanks for your posting and using Aspose.Cells.

We were able to replicate this issue by executing your code with the latest version: Aspose.Cells for .NET v8.7.2.2 and found that percentage data is not showing up properly.

We have logged this issue in our database for investigation. We will look into it and fix this issue. Once the issue is resolved or we have some other update for you, we will let you know asap.

This issue has been logged as

  • CELLSNET-44367 - Percentage data is not showing up properly

I have also attached the output excel file and the screenshot highlighting the issue for a reference.

Hi,


I have the same problem, but with Apsose Cells for Java v.8.8.2. Can you confirm that this issue also applies to the Java version?
And can you give any information on when this issue will be fixed?

Best regards
Stefanie

Hi Stefanie,


Thank you for contacting Aspose support.

Please note, the ticket logged earlier as CELLSNET-44367 has not been resolved yet, therefore the current revisions of Aspose.Cells for .NET & Java will have this problem. It would be appropriate that you create a new thread with problem description, source code and spreadsheet. We will evaluate the scenario with most recent release of Aspose.Cells for Java and share our findings. In case the issue persists in the latest Java release, we have to log a separate ticket based on your template file for thorough investigation.

Hi Dmitry,


Please try the following piece of code to retain the percentage values in the Pivot Table. Please note, we have tested the scenario while using the latest revision of Aspose.Cells for .NET 8.8.2.8.

C#

var workbook = new Workbook(dir + “sample.xlsx”);
foreach (Worksheet sheet in workbook.Worksheets)
{
foreach (PivotTable pt in sheet.PivotTables)
{
pt.RefreshData();
pt.CalculateData();
pt.RefreshDataOnOpeningFile = true;
}
}
workbook.Save(dir + “result.xlsx”);

Hi Stefanie,

stefgt:
I have the same problem, but with Apsose Cells for Java v.8.8.2. Can you confirm that this issue also applies to the Java version?
And can you give any information on when this issue will be fixed?

I have tested the scenario while using the latest version of Aspose.Cells for Java 8.8.2.9 against the sample spreadsheet shared in this thread. The below code correctly displays the percentage values in the Pivot Table. Please give this solution a try on your side and let us know your feedback. In case the problem persists, we need to review your complete code as well as the source spreadsheet in order to isolate the problem cause, therefore please create a new thread with above requested details/artifacts.

Java

Workbook workbook = new Workbook(dir + "sample.xlsx");
for (int w = 0; w < workbook.getWorksheets().getCount(); w++)
{
Worksheet sheet = workbook.getWorksheets().get(w);
for (int p = 0; p < sheet.getPivotTables().getCount(); p++)
{
PivotTable pt = sheet.getPivotTables().get(p);
pt.refreshData();
pt.calculateData();
pt.setRefreshDataOnOpeningFile(true);
}
}
workbook.save(dir + "result.xlsx");