This is a migrated thread and some comments may be shown as answers.

Indian number format in Telerik report

8 Answers 175 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kunal Bagga
Top achievements
Rank 1
Kunal Bagga asked on 19 Aug 2014, 10:30 AM
Hi,
In my report cultureInfo will differ on different conditions. Regards of all the other culture,I am facing little problem in implementing the Indian culture format. Especially during the number format. 
If I set the culture to en-IN => it works fine but it is in the format of ###,##,###.## which I don't need. So I implemented with hi-IN . Though the number format is fine the numbers are not displayed as normal numbers (they are displayed as numerals of the current culture). Please find the attached picture of the numbers displayed for this. 

Can you help me in implementing the culture ie the number format has to be ##,##,##,###.## and has to be displayed in normal numbers. 


8 Answers, 1 is accepted

Sort by
0
Hinata
Top achievements
Rank 1
answered on 22 Aug 2014, 10:06 AM
Hi Kunal,

Is it possible for you to share the actual report definition?
0
Kunal Bagga
Top achievements
Rank 1
answered on 25 Aug 2014, 03:34 AM
Hi Hardik, 
You could duplicate the issue in any telerik report. I am using HTML5 report (Its best for you to use that also).

In the report please follow the conditions below
  * Add a table which shows number in any column. (Please have the numbers to be at-least 9 digits)
  * You can change the Culture of the report to en-IN , hi-IN
  * While using hi-IN you could see the difference in the way numbers are displayed. 

My requirement is I wanted display numbers in 00,00,00,000 format. 
If I use "en-IN" format, I am getting  0,000,00,000 format
but when "hi-IN" format, I am getting the correct format but numbers are displayed differently. 

May I know how can I achieve this? Please note that the culture of the report varies differently based on the project. If it is Indian project we will change the culture to this but if it is Singapore/ Malaysian project we will display the numbers accordingly. So we cannot hard code the format here.

Hope you understand. 



0
Hinata
Top achievements
Rank 1
answered on 27 Aug 2014, 02:12 PM
Hi Kunal,

The en-IN culture currency format is working as expected on my PC. Check this screenshot.
0
Kunal Bagga
Top achievements
Rank 1
answered on 28 Aug 2014, 07:36 AM
Mine is displaying in this format( Find the attached pic). What problem this could be?
0
Stef
Telerik team
answered on 02 Sep 2014, 09:27 AM
Hello Kunal,

If you are checking the results on preview in Visual Studio, the report will be displayed with the culture settings for Visual Studio. To get the actual result you need to create a project with a viewer and change the current thread culture. For example check the attached demo project (the culture can be changed in the Program.cs file).
Additional details about globalization are available in the Report Globalization help article.

Having this into account, when you specify the CultureInfo, you can provide custom format for numbers as well.


I hope the above information helps you.

Regards,
Stef
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Kunal Bagga
Top achievements
Rank 1
answered on 05 Sep 2014, 09:20 AM
Hi Stef, 
Thanks for your reply. 

I have tried your solution, but still I couldn't get a valid solution. I have attached the different methods that I tried for this. 

reportViewer.jpg => this is how I implement the viewer for this report. 
aspxLoad.jpg => I tried the threading during the load page. This shows how I use the code.
reportBackEnd => I tried the threading in needDataSource. This I tried with and without threading in main aspx page. 
result => the result I get.

Thanks for processing the reply. Would be good if you get process this request fast and give us a reply asap 



0
Kunal Bagga
Top achievements
Rank 1
answered on 05 Sep 2014, 10:49 AM
Hi Stef, 
Please ignore the last post. I have found the solution for this. I used the following code in the NeedDataSource event and it works fine.

CultureInfo myCL = new CultureInfo("en-IN", false);
                        CultureInfo myCIclone = (CultureInfo)myCL.Clone();
                        NumberFormatInfo numberFormat = myCIclone.NumberFormat;
                        int[] mySize = { 3, 2 };
                        numberFormat.NumberGroupSizes = mySize;
                        numberFormat.CurrencyGroupSizes = mySize;
                        this.Culture = myCIclone;

Thanks for your time. 

0
hemanth
Top achievements
Rank 1
answered on 16 Feb 2017, 11:16 AM

In search of an answer to my post in stack overflow, I reached here. It seems to be a problem with server version.

http://stackoverflow.com/questions/42202771/numbergroupsizes-for-en-in-culture-in-windows-server-2012-is-wrong

Tags
General Discussions
Asked by
Kunal Bagga
Top achievements
Rank 1
Answers by
Hinata
Top achievements
Rank 1
Kunal Bagga
Top achievements
Rank 1
Stef
Telerik team
hemanth
Top achievements
Rank 1
Share this question
or