Current Culture not respected when loading SpreadSheetML

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.

@darren.fitzgibbon,

Thanks for your query with sample code.

Could you try to use the following line of code instead:
e.g
Sample code:

LoadOptions loadopt = new LoadOptions() { CultureInfo = new System.Globalization.CultureInfo(“en-GB”), LanguageCode = CountryCode.UnitedKingdom, Region = CountryCode.UnitedKingdom };

if it works for your needs.

If you still find the issue, kindly do provide details about your region/language settings set on your machine. Also, provide your template XML file (“report.xml”) and some screenshots to highlight the problematic data in the sheet, we will check it soon. Moreover, please provide your expected formatting/style of currency values.