Home » Eclipse Projects » BIRT » how to control the language of date format (like month)
| how to control the language of date format (like month) [message #688201] |
Fri, 24 June 2011 03:02  |
tong123123 tong123123 Messages: 74 Registered: April 2011 |
Member |
|
|
for a chart x-axis, it is datetime.
I set the format to short, date time.
when I run the report, it show as a expected, but when run in client machine, the date shown strange symbol, it seems it cannot shown the chinese character about month.
is there any method to force the output to english like
May/12/2011 1:00 pm
instead of chinese
5ζ/12/2011 ζδΈ1:00
also, which setting control the display of date to chinese or english? in browser or in windows regional settings??
for e.g. MMM/dd/yy HH:mm, what setting control the display of MMM to english or chinese?
My birt designer version is 2.2.1
[Updated on: Fri, 24 June 2011 03:07] Report message to a moderator
|
|
| | | | | | | |
| Re: how to control the language of date format (like month) [message #689644 is a reply to message #689481] |
Tue, 28 June 2011 00:03   |
tong123123 tong123123 Messages: 74 Registered: April 2011 |
Member |
|
|
My eclipse birt plugin version is
Eclipse BIRT Designer Version 2.2.1.r221_v20070924 Build <2.2.0.v20070924-1550
and so cannot run your attachment, but I copy
Quote:
reportContext.getDesignHandle().setStringProperty("locale", params["ReportLocale"].value);
in report beforeFactory method
and
Quote:
<scalar-parameter name="ReportLocale" id="23564029">
<property name="valueType">static</property>
<property name="dataType">string</property>
<property name="paramType">simple</property>
<property name="controlType">list-box</property>
<property name="mustMatch">true</property>
<property name="fixedOrder">true</property>
<property name="distinct">true</property>
<structure name="format">
<property name="category">Unformatted</property>
</structure>
<list-property name="selectionList">
<structure>
<property name="value">de_DE</property>
</structure>
<structure>
<property name="value">fr_FR</property>
</structure>
<structure>
<property name="value">zh_TW</property>
</structure>
<structure>
<property name="value">en_US</property>
</structure>
</list-property>
</scalar-parameter>
inside parameters attribute,
then when I run the report, the locale selection list come out, but whatever value I choose, the date display does not change (chinese, english, france...), why?
is the method not valid in birt version 2.2.1.r221_v20070924?
|
|
|
| Re: how to control the language of date format (like month) [message #689878 is a reply to message #689644] |
Tue, 28 June 2011 10:23   |
Jason Weathersby Messages: 9167 Registered: July 2009 |
Senior Member |

|
|
In 2.2.1 you have to set it like
reportContext.getReportRunnable().designHandle.getDesignHandle().setStringProperty("locale",params["ReportLocale"]);
I believe.
Jason
On 6/28/2011 12:03 AM, forums-noreply@eclipse.org wrote:
> My eclipse birt plugin version is Eclipse BIRT Designer Version
> 2.2.1.r221_v20070924 Build <2.2.0.v20070924-1550
> and so cannot run your attachment, but I copy
> Quote:
>> reportContext.getDesignHandle().setStringProperty("locale",
>> params["ReportLocale"].value);
>
> in report beforeFactory method
> and Quote:
>> <scalar-parameter name="ReportLocale" id="23564029">
>> <property name="valueType">static</property>
>> <property name="dataType">string</property>
>> <property name="paramType">simple</property>
>> <property name="controlType">list-box</property>
>> <property name="mustMatch">true</property>
>> <property name="fixedOrder">true</property>
>> <property name="distinct">true</property>
>> <structure name="format">
>> <property name="category">Unformatted</property>
>> </structure>
>> <list-property name="selectionList">
>> <structure>
>> <property name="value">de_DE</property>
>> </structure>
>> <structure>
>> <property name="value">fr_FR</property>
>> </structure>
>> <structure>
>> <property name="value">zh_TW</property>
>> </structure>
>> <structure>
>> <property name="value">en_US</property>
>> </structure>
>> </list-property>
>> </scalar-parameter>
>
> inside parameters attribute, then when I run the report, the locale
> selection list come out, but whatever value I choose, the date display
> does not change (chinese, english, france...), why?
> is the method not valid in birt version 2.2.1.r221_v20070924?
Jason Weathersby
BIRT Exchange
|
|
| | | |
| Re: how to control the language of date format (like month) [message #692030 is a reply to message #691886] |
Sun, 03 July 2011 04:17   |
tong123123 tong123123 Messages: 74 Registered: April 2011 |
Member |
|
|
I change something in beforeFactory and it is now like the following
Packages.java.lang.System.out.println ("--beforeFactory");
try{
importPackage(Packages.java.util);
Packages.java.lang.System.out.println("after importPackage");
Packages.java.lang.System.out.println("locale = " + reportContext.getLocale().toString());
var loc = new Locale("en_US");
_jsContext.setLocale(loc);
Packages.java.lang.System.out.println("locale = " + reportContext.getLocale().toString());
}catch(ex){
Packages.java.lang.System.out.println ("error in beforeFactory, locale");
}
the output see in eclipsec.exe prompt is
Quote:
--beforeFactory
after importPackage
locale = zh_TW
locale = en_us
this.queryText: select *
from contract_current_salary
where current_salary >= '20000'
order by current_salary;
text onCreate run
text onCreate finish
text onRender run
text onRender finish
it seems the locale is already change to en_us, but the report output is still in chinese format as attach (localeProblem2.jpg)!!
why?
My birt designer version is 2.2.1
[Updated on: Sun, 03 July 2011 04:21] Report message to a moderator
|
|
| | | | | | | | | |
Goto Forum:
Current Time: Wed Jun 19 21:45:21 EDT 2013
Powered by FUDForum. Page generated in 0.02483 seconds
|