|
Re: How to set date format programmatically [message #541844 is a reply to message #541809] |
Tue, 22 June 2010 17:08 |
|
Reinhard,
We should have a StructureFactory implementation for this. Can you
open a bug for it? You can do what you want using this code:
FormatValue formatValueToSet = new DateTimeFormatValue( );
formatValueToSet.setPattern( "dd/mm/yy" );
formatValueToSet.setCategory("Custom");
data.setProperty( StyleHandle.DATE_TIME_FORMAT_PROP,
formatValueToSet );
You can also call data.getStyle().setDateTimeFormat if a style exist for
the data item.
Jason
On 6/22/2010 11:18 AM, Reinhard wrote:
> Hello guys,
>
> I create a report programmatically and have a date-time column. Data for
> this column comes in short format, like 22.06.10. 15:06:53 I have to set
> this column to date-time data type.
> I do it this way:
> computedColumn.setDataType(DesignChoiceConstants.COLUMN_DATA
> _TYPE_DATETIME);
>
> Now I get a following output: 22.06.0010 15:06:53. The year has 4 digits
> and first two are 00.
>
> The question is, how can I set the DateTime format. I found a constant
> for this, DesignChoiceConstants.DATETIEM_FORMAT_TYPE_SHORT_DATE but how
> to set it ant to which component.
>
> Thanks in advance.
> Reinhard
|
|
|
Powered by
FUDForum. Page generated in 0.03059 seconds