I am trying to load a legacy report written in SpreadsheetML which defines styles which format the cell data to Currency.
I have tried setting the LoadOptions to set the Culture to en-GB and the region and language to CountryCode.UnitedKingdom but Aspose.Cells will not use these settings to set the display text of the Cells styled with this style. Code sample below:
var contents = File.OpenRead(@"c:\temp\report.xml");
LoadOptions loadopt = new LoadOptions() { CultureInfo = System.Globalization.CultureInfo.CurrentCulture, LanguageCode = CountryCode.UnitedKingdom, Region = CountryCode.UnitedKingdom };
Workbook workbook = new Workbook(contents, loadopt);
workbook.Settings.CultureInfo = System.Globalization.CultureInfo.CurrentCulture;
workbook.Save(@"c:\temp\reportAspose.xls");
I have checked the styles collection and can see a style matching the correct definition for the target Culture, but the cell uses a different style from the style pool which uses the US style currency definition.
We used to use the OWC control with the same report source with no problems. I can’t find any way of loading the Spreadsheet ML file with the correct culture. Saving the resulting file as XLS or XLSX sets these cells with a US currency format.
I need to be able to format this file based on the current culture, as some of the user’s sessions use different cultures.