Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 320493

Summary: Set date/time format programmatically, StructureFactory implementation
Product: z_Archived Reporter: Reinhard <reinhard.klausel>
Component: BIRTAssignee: Birt-Data-inbox <Birt-Data-inbox>
Status: NEW --- QA Contact: mindan xu <mindan.xu>
Severity: normal    
Priority: P3 CC: bluesoldier, lzhu
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Reinhard CLA 2010-07-21 08:25:10 EDT
Build Identifier: 20100218-1602

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 and to which component.

Jason Weathersby wrote:
We should have a StructureFactory implementation for this.

Reproducible: Always
Comment 1 Xiaoying Gu CLA 2010-11-18 22:10:48 EST
(In reply to comment #0)
Hi, Reinhard

Could you attach your test report?
Comment 2 Lin Zhu CLA 2011-04-06 16:24:56 EDT
Hey Reinhard,

Can you try to use a data time value which follow ISO8601 standard? The property DesignChoiceConstants.DATETIEM_FORMAT_TYPE_SHORT_DATE is not used for parsing the Date value. It is only for formatting.

Thanks.
Lin