Skip to content

DateTime formats in the RDLC file

January 21, 2013

Last week, having sorted out the date time format to dd/MM/YYYY in the aspx pages, I had assumed that the data sent out from the DataTable would also reflect in the rdlc files. The answer in fact was “no”, there seem to be a default value of MM/dd//YYYY hh:mm:ss within the rdlc files.

Having looked up on this, the result is: –

In the report (rdlc) ,

Right Click in the Field, select properties,

Select the Tab Format, and use the format code you need.

d Short date
D Long date
t Short time
T Long time
f Full date/time (short time)
F Full date/time (long time)
g General date/time (short time)
G General date/time (long time)

If you go the design page of the RDLC file, right clikc the DateTime field, and go to Properties, then go to the Format tab.

Inside there is a Format Code textbox, this is where you can specify your date time format other than the usual US date time, so for the UK one is dd/MM/yy HH:mm. That is how you change and override the default value, so for your custom reports that you want to generate PDF and Excel files, you need to this step.

Hope that helps.

From → Uncategorized

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: