This is a migrated thread and some comments may be shown as answers.

Formatting embedded expressions

1 Answer 355 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ville
Top achievements
Rank 1
Ville asked on 09 May 2009, 07:35 PM
Hello there,

Is there any possibility to define formatting for embedded expressions? I am providing a DateTime parameter for the report and would like to use it in an embedded expression. However, it formats always as a full date (with the time part), even I'd like to have only date part printed. I could not find any information from the previous threads nor documentation.

So, any advice is welcome. =)

Thanks,
Ville

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 11 May 2009, 03:28 PM
Hello Ville,

You can do this either directly in the expression editor by casting to Date and using one of the formatting methods of the DateTime object:

= CDate(Parameters.Parameter1).ToShortDateString()

or by creating an user function, that would format the date accordingly in your favorite language (C#, VB.NET) and set it to the textbox like so:

= TruncateTime(Parameters.Parameter1) 

All the best,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
General Discussions
Asked by
Ville
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or