Formatting a number in excel export depennding on user settings

Hi all,

We have an application that, as part of its functionality, exports a GridView to Excel.

The issue we have is that the language of the server is set to a specific value, say French, but the user logging in is on a British set PC, so, when the export to excel happens, the formatting of numbers is incorrect.

There are two possibilities that we can think of:

1) To use some kind of JavaScript to set the formatting based on the users browser settings.

2) Against the users log in account, set a format value and add it to the session so that when they export, the format is picked up and applied.

What do you think, is one option better/quicker/easier than the other or are there other possibilities?

Thank you.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I can't give you a specific answer without knowing the details of how your server is set up (what scripting language you're using, etc.), but in general terms, you should detect the Locale of the user when they log in, and then use that Locale for all their interactions in session. That'll make sure that if there are any other places that are Locale-dependent (or if you later add such functionality), you won't have to keep changing the script every time.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
resourcesysAuthor Commented:
Hi btdownloads7,

I have taken your advice (sort of) and will use a user setting that is kept on the session. When an export to excel is performed, any number fields will be formatted to the culture set on the session.


It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.