Trying to format date inside of text box.

1 Answer 2276 Views
Report Designer (standalone)
Eric
Top achievements
Rank 1
Eric asked on 01 Oct 2015, 10:29 PM
I'm trying to show the data range selected as parameters in the header of the report. I added a text box and added {Parameters.StartDate.Value}. The problem is it shows the time and I just need the date. I tried this { Format('{0:d}',Parameters.StartDate.Value)} but it does not work. What is the proper way to accomplish my objective. Thanks in advanced. 

1 Answer, 1 is accepted

Sort by
0
Accepted
Stef
Telerik team
answered on 06 Oct 2015, 03:31 PM
Hello Jet,

The following expression works as expected as a value of a TextBox item:
= Format('{0:d}', Parameters.Parameter1.Value)
The above expression is tested with Telerik Reporting Q3 2015. The expression uses the Format text function and standard Date and Time format strings.


Other approach is to use the TextBox item's Format property, where formats will be displayed depending on the application's current culture - Report Globalization.


Let us know if you have any further questions.

Regards,
Stef
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Eric
Top achievements
Rank 1
commented on 06 Oct 2015, 04:54 PM

Thanks a lot Stef.
NPL IT
Top achievements
Rank 1
commented on 16 Dec 2020, 08:20 PM

Hi the proposed solution gives you day of week number, not date without time.  The attached links don't show how to format date without time.  Is there another document that shows an example of stripping time from a date using an expression.

NPL IT
Top achievements
Rank 1
commented on 16 Dec 2020, 08:23 PM

Ignore, sorry

 

Tags
Report Designer (standalone)
Asked by
Eric
Top achievements
Rank 1
Answers by
Stef
Telerik team
Share this question
or