I am having an issue with exporting data from my ag-grid table to excel using the API method getDataAsExcel.
The problem arises because I have a column containing only string values, while all other columns are numeric and displayed in the ag-grid table as "6,999,500".
Despite this display format, when I export the data, all columns are saved with the format "General" or String instead.
For example, if my ag-grid table looks like this:
TABLE
name | salary | fee
john | 10,000 | 14
dany | 50 | 1,000
where, name -> string
salary -> numeric
fee -> numeric
It's strange that when exported to excel, all the values are saved as "String", except for 14 and 50 in this case. I observed that the numbers without commas (like 14 and 50) are exported as numeric, while those with commas (such as 10,000 and 1,000) are exported as string.
I attempted to use the parseInt() function like this:
if value = 10,000
parseInt(value.replace(/,/g, ''));
Even after replacing 10,000 with its parsed value, it still remains a String when exported.
Is there a way to change the formatting of the entire column, or at least parse these values individually?
Any assistance would be greatly appreciated!