Currency symbol in excel2003 gets converted to pounds always

Hi Support,

We are having an excel document of 2003 and that has data with currency symbol $, which after converting to PDF gives data in pounds, could you please help us in sorting this issue.

Thanks and regds,
Sai Dhulipala

@Kofax_Business_Communications,

I have tried the following sample code and it works fine.

Workbook wb = new Workbook();
Cells cell = wb.Worksheets[0].Cells;
cell[0, 0].PutValue(1000);
Style style = wb.CreateStyle();
style.Custom = "$#,##0.00";
cell[0, 0].SetStyle(style);
wb.Save("currencystyle2.xlsx");
Workbook workbook = new Workbook("currencystyle2.xlsx");
workbook.Save("currencystyle2.pdf");

If your issue is not resolved, please share your sample Excel file and a runnable console application for testing. Also provide details of your environment where this application is executed.

detail-1127-for-2021-03-31-gilbane_inc.zip (16.1 KB)

Hi Support,

Our customer agreed to share this file.
Uploaded excel file which is causing the issue.
Could you please look into this issue.

Thanks and regds,
Sai Dhulipala

@Kofax_Business_Communications,
We were able to observe the issue but we need to look into it more. We have logged the issue in our database for investigation and for a fix. Once, we will have some news for you, we will update you in this topic.

This issue has been logged as

CELLSNET-48102 - Currency symbol in excel2003 gets converted to pounds

@Kofax_Business_Communications,

We evaluated your issue further. We found it is not an issue with the APIs. Your issue is due to the fact that the region saved in the template file is UnitedKingdom. If you need to get cells to be formatted with other regions, such as USA, you should change the regional settings/locale to the expected value. See the sample lines of code for your reference.

workbook.Settings.Region = CountryCode.USA;
or
workbook.Settings.CultureInfo = ....

Hope, this helps a bit.

Thanks Amjad,

Here the issue as you must have already seen a currency mentioned for example
100 pounds after converting shows as 100 dollars.
Is this correct?

Customer gets this kinds of excel sheets from multiple countries.
Could you give more details on the solution based on the issue mentioned above.

Thanks and regds,
Sai Dhulipala

Yes, it is correct. As we told you that the region saved in your template file is UnitedKingdom. If you need to get cells to be formatted with other regions, you need to change the regional settings/locale to your desired one. So, you will set the region or culture info (as we pasted the line(s) of code) accordingly for your needs.

You got to specify your desired Region/CultureInfo for all your workbooks’ settings before rendering to PDF file format.

We do not wont to change the currency, what ever is in the file it should come as it is, why is the currency symbol changed during conversion.

This does not happen with latest excel like MS Excel 2016 or above which also has templates as well.

Are we missing something here?

@

Please note, if you do not use the line(s) of code (we suggested in the post), then the regional settings saved in the workbook would be rendered in the output PDF too.

@Kofax_Business_Communications
Ms excel always uses the language settings of itself(if not set, then uses the default regional settings of the environment), so you get the formatted value as 100 dollars when you open given template file in ms excel. However, for user’s requirement and flexibility, we support users to set different regions on workbook level, and use the set one if there are regional settings in the template file. For the given template file, if you set the regional settings of your system or ms excel as UnitedKingdom and then open it, you will see the same result(the currency becomes 100 pounds). It is just the behavior of ms excel for number formatting for different locales, not the change of currency value itself.

So, if you need all template files to be formatted as what you can get from ms excel when you open them in ms excel with your current system, please always reset the region of workbook(loaded from those template files) to the same one with your system.

Thanks Support team,
When we set Region to Default it is solving the issue, do you see any side effects due to this change.

@Kofax_Business_Communications,

There should be no side effects and you may change the region accordingly.