如何在RDLC报告中设置en-GB文化? [英] How to set en-GB Culture in RDLC Reports?
问题描述
我将我的应用程序的文化设置为Program.cs文件中的en-GB,如下所示,
I set culture of my application to en-GB in Program.cs file as below,
System.Globalization。 CultureInfo cultureInfo = new System.Globalization。 CultureInfo (" en-GB" );
System.Globalization.CultureInfo cultureInfo = new System.Globalization.CultureInfo("en-GB");
System.Globalization。 NumberFormatInfo numberInfor = new System.Globalization。 NumberFormatInfo ();
System.Globalization.NumberFormatInfo numberInfor = new System.Globalization.NumberFormatInfo();
Int32 [] grp = {3,2, 2,2,2,2,2 };
Int32[] grp ={ 3, 2, 2, 2, 2, 2, 2 };
numberInfor.CurrencyGroupSizes = grp;
numberInfor。 NumberGroupSizes = grp;
cultureInfo .NumberFormat = numberInfor;
Application .CurrentCulture = cultureInfo;
Application.CurrentCulture = cultureInfo;
Thread .CurrentThread.Current Culture = cultureInfo;
Thread.CurrentThread.CurrentCulture = cultureInfo;
< span style ="color:teal"> Thread .CurrentThread.CurrentUICulture = cultureInfo;
Thread.CurrentThread.CurrentUICulture = cultureInfo;
但它不影响数字格式& RDLC报告中的日期格式。
我听说过我们必须在RDLC报告中专门设置它?
请建议我在哪里设置以及如何设置在RDLC报告中?
推荐答案
有几种方法可以影响报告中的信息格式。
一种方法是设置语言:
打开报告
选择"报告"。在属性网格中
设置适当的语言属性
另一种方法是使用文本框的格式属性:
右键单击文本框并选择属性。
打开格式选项卡
输入格式代码的Microsoft .NET Framework格式代码
您也可以使用自定义代码
打开报告 - >报告属性...菜单项。
打开代码选项卡
创建Visual Basic方法以格式化数字和日期的方式。
通过调用"= Code.MethodName"在表达式中使用方法NumerToFormat)"
最后两个为您提供更多自定义格式化的可能性。
There are a few ways to affect the format of information in a report.
One is to set the Language:
Open the report
Select "Report" in the Properties grid
set Language property appropriately
Another is to use the Format property of the textbox:
Right click the textbox and select Properties.
Open the Format tab
Enter a Microsoft .NET Framework formatting code for the the Format Code
Also you can use Custom Code
Open the Report -> Report Properties... menu item.
Open the Code tab
Create Visual Basic methods to format the numbers and dates how you want.
Use the method in the expression by calling "=Code.MethodName(NumerToFormat)"
The last two give you more customized formatting possibilities.
这篇关于如何在RDLC报告中设置en-GB文化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!