function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
hemanth tanguturi 10hemanth tanguturi 10 

comma seperator issue in csv download from vf page

Hi,

I have a issue with comma seperator in csv file download.
<apex:page controller="AnalysisController"   contentType="application/vnd.ms-excel#Analysis.csv">
<apex:outputText value="{!price}" >
this is what i am using in the vf page to print the price value. Here price is a string 6,44,567.00  as this string is having comma the out put is splitting in to different cells, like 6 in one cell 44 in other and 567.00 in other cell.
How can I over come this issue?
1) As the source of my report is from multiple Maps i am not able to download in xls
2) Tried to use format for outputtext component but here in my case the value is string
3) Tried to remove the comma using substitue but as my app supports multiple locale, people in some locale uses comma as decimal seperator hence can't remove comma.

Thanks in advance.

Hemanth
SandhyaSandhya (Salesforce Developers) 
Hi,

You will have to enclose the contents within double quotation marks " ".

For example,
Column_1__c,Column_2__c,Column_3__c AAA,"BBB,CCC",DDD
I would suggest you refer below link which has answers for the same.

http://stackoverflow.com/questions/769621/dealing-with-commas-in-a-csv-file

Hope this helps you!

If this helps you, please mark it as solved so that it will be available for others as a proper solution.

Thanks and Regards
Sandhya