Pricing changes are coming in January. Contact our Sales team to secure the current price for your desired license.

Maintaining Currency Format in Exported Excel

Answered
Amogh Arsekar asked on October 4, 2024

Hello,

I noticed that the currency format is not maintained in the exported excel. For example, if the flexmonster grid shows 48,523,389.00 in a cell, it changes to 4,85,23,389.00 in the exported excel. Is there a way to enforce a format and prevent it from changing when the grid is exported? I suspect Microsoft Excel is picking up the formatting based on some default but it would be great if I can prevent it by enforcing a format.

9 answers

Public
Maksym Diachenko Maksym Diachenko Flexmonster October 4, 2024

Hello, Amogh!

Thank you for writing to us.

As you mentioned, the issue with the number format in the exported Excel files is caused by regional formatting settings. Excel applies formatting based on the system locale, which can lead to differences in number representation. The format used in Flexmonster cannot be enforced for Excel, and you can only set it in Excel settings, as described in this guide: https://support.microsoft.com/en-us/office/change-the-character-used-to-separate-thousands-or-decimals-c093b545-71cb-4903-b205-aebb9837bd1e

Please let us know if this solution works for you.

Best Regards,
Maksym

Public
Amogh Arsekar November 8, 2024

Hello,

I understand that Flexmonster doesn't enforce the format in the exported Excel file. But is there a way to change the locale format used in the pivot grid? I checked that the formatObject for number formatting only allows me to change the currency symbol, negative symbol and seperators but doesn't allow me to configure how those seperators are placed. For example, for the US I would use Millions (1,000,000) but for India I would use Lakhs (10,00,000). Is there a way to configure this?

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster November 11, 2024

Hello, Amogh!

Thank you for writing to us.

Currently, Flexmonster's number formatting does not support Lakhs. However, you can use the customizeCell method to format numbers using JavaScript's locale formatting tools, which will add the separators accordingly to the chosen locale. Please check the following example: https://jsfiddle.net/flexmonster/robht7ef/
However, note that the values changed with the customizeCell would be exported as strings to Excel.

Please let us know if the suggested solution works for you.

Best Regards,
Nadia

Public
Maksym Diachenko Maksym Diachenko Flexmonster November 19, 2024

Hello, Amogh!

Hope you are doing well.
We are wondering if you had time to check the suggested workaround for applying a Lakh format to numeric cells.
Please let us know if it works for you.

Best Regards,
Maksym

Public
Amogh Arsekar November 20, 2024

Hello,

I am unable to use this workaround since the values changed with customizeCell are exported as strings and we require them to be formatted numbers so that users can perform calculations in the generated excel.

I would really appreciate if you can let me know if there are any plans to add support for Vedic number format to Flexmonster. It is a necessity for all our Indian clients.

Thanks

Public
Maksym Diachenko Maksym Diachenko Flexmonster November 20, 2024

Hello, Amogh!

Thank you for your reply.

To address this issue, you can customize the export process using the exportTo API call. In this method, you can set the useCustomizeCellForData parameter as false to ignore the custom Lakh formatting applied with the customizeCell. This approach would allow the compromise scenario when:

  1. Numbers are formatted as Lakhs in Flexmonster.
  2. When exported to Excel, numeric data will be recognized as numbers, and it would be possible to format them as Lakhs.

Additionally, you can customize the toolbar to overwrite the default export handler and use the modified export.
Check the JSFiddle sample illustrating this approach: https://jsfiddle.net/flexmonster/946gf3y1/

Please let us know if this solution would work for you.

Best Regards,
Maksym

Public
Maksym Diachenko Maksym Diachenko Flexmonster December 10, 2024

Hello, Amogh!

Hope you are doing well.
Our team is wondering if you tried using the approach recommended in our previous response to both show numbers as Lakhs on a client while being able to change their format in an exported Excel sheet.
Please let us know if it worked for you.

Best Regards,
Maksym

Public
Amogh Arsekar 2 days ago

Hello Maksym,

Yes, I was able to use the recommended workaround to get the desired functionality that I require.

Public
Maksym Diachenko Maksym Diachenko Flexmonster 2 days ago

Hello, Amogh!

Thank you for your reply.
We are glad to hear that the proposed solution worked for you.
Feel free to contact us if more questions arise.

Best Regards,
Maksym

Please login or Register to Submit Answer