Formatting a number in excel export depennding on user settings

Posted on 2014-08-22
Medium Priority
Last Modified: 2014-08-25
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.

Question by:resourcesys
LVL 14

Accepted Solution

btdownloads7 earned 1500 total points
ID: 40279157
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.

Author Comment

ID: 40282698
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.



Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.
Suggested Courses
Course of the Month16 days, 19 hours left to enroll

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question