Workbook RefreshChartCache option does not take into consideration regional and language settings

Hello,

We’ve discovered an issue with the RefreshChartCache save option, it seems this operation does not take into consideration the regional and language settings.

I’ve attached a sample console application, which uses an input TestFile.xlsx containing a chart, opens it and saves it using Aspose’s RefreshChartOption. Before running the application, please change the Regional and language settings to “French (France)”.

When looking into the TestFileAfterSave.xlsx generated file, you can see the \xl\charts\chart1.xml file is quite different than the one from the input test file:
- <c:lang val=“en-US”/> is missing
- <c:formatCode>General</c:formatCode> is missing from all 3 <c:numCache> nodes
- all 3 <c:numCache> nodes report as containing 6 values in the plot area, instead of 3.

I’ve also attached both the chart1.xml files for reference.

The problem seems to be bypassed by MS Office, but other OpenXML editors will fail to correctly display the chart, due to the incorrect no. of values (6 instead of 3) saved within the chart’s cache.

We are using Aspose.Cells version 8.0.1.0.

Any feedback will be highly appreaciated.

Thank you,
Mihai Andrei
Sr Software Engineer
IBM Romania

Hi Mihai,

Thanks for your posting and using Aspose.Cells.

Kindly highlight your issues in some screenshots with red circles around the target/desired areas. It will help us look into your issue more closely and we will update you asap.

Could you please also highlight how your chart looks like in correct form? And how it is looking with Aspose.Cells generated Excel file?

Hello,

I think I’ve already did that - please see the attached xml files - the chart1_TestFileAfterSave.xml is from within the Excel as generated by Aspose, the chart1_TestFile.xml is from within the original test excel file and this represents the correct version.

You can compare the two for differences, I’ve already detailed how…

Thank you,
Mihai Andrei

Hi Mihai,

Thanks for your posting and using Aspose.Cells.

I was able to notice the difference between source chart1.xml and re-saved chart1.xml as mentioned by you.

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

This issue has been logged as CELLSNET-42646.

Hi,

Please try our latest version/fix: Aspose.Cells for .NET 8.2.1.2
We have fixed the issue. We save the “lang” and “formatCode” element into chart.xml.

Let us know your feedback.

Thank you.

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


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Hi,

We are currently using Aspose.Cells 8.3.2.1 and it seems the 3rd issue from my colleague’s post is still present: “all 3 <c:numCache> nodes report as containing 6 values in the plot area, instead of 3.”.
For reproducing the issue please run the following code on two machines having Regional and language settings set to English (USA) and French (France):

private static void Main()
{
var workbook = new Workbook(“test.xlsx”);
byte[] workbookContent;

using(var memoryStream = new MemoryStream())
{
workbook.Save(memoryStream, SaveFormat.Xlsx);
workbookContent = memoryStream.ToArray();
}

var refreshedWorkbookContent = RefreshWorbookChartCache(workbookContent);

using (var fs = new FileStream(“chart.xlsx”, FileMode.Create))
{
fs.Write(refreshedWorkbookContent, 0, refreshedWorkbookContent.Length);
fs.Flush();
}
}

private static byte[] RefreshWorbookChartCache(byte[] workbookContent)
{
using (var conversionStream = new MemoryStream())
{
using (var tempStream = new MemoryStream(workbookContent))
{
var asposeDocument = new Workbook(tempStream)
{
Settings = { CultureInfo = new System.Globalization.CultureInfo(“fr-FR”) }
};
var saveOptions = new OoxmlSaveOptions(SaveFormat.Xlsx) { RefreshChartCache = true };
asposeDocument.Save(conversionStream, saveOptions);
}
return conversionStream.ToArray();
}
}


I’m attaching here the resulted files (chart-En.xlsx and chart-Fr.xlsx) and their corresponding chart1.xml files (chart-En.xml and chart-Fr.xml) extracted from these files.
By comparing these two xml files you’ll notice the file resulted on the machine set to French in NumCache have actually 18 values instead of 9 values as it should have. What is happening is the integer part and the decimal part of each value are actually interpreted as two separate values on the machine set to French.
Please see the attached image (XmlCompared.jpg) showing these differences.

Best regards,
Aurelian Iordache
IBM Romania

Hi,


Thanks for the template files, sample code and screen shot.

I observed the issue as you mentioned, the part of the issue “all 3 <c:numCache> nodes report as containing 6 values in the plot area, instead of 3.” is still there with our latest version/fix: Aspose.Cells for .NET v8.3.2.2. I have reopened your original ticket logged as “CELLSNET-42646”. We will investigate and look into it soon.

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

Thank you.

Hi,


Please try our latest version/ fix: Aspose.Cells for .NET v8.3.2.4
We have fixed your issue “CELLSNET-42646” now.

Let us know your feedback.

Thank you.