format datetime inside HTMLTextBox expression - remove seconds

2 posts, 0 answers
  1. Aron
    Aron avatar
    80 posts
    Member since:
    Dec 2005

    Posted 09 Aug Link to this post

    Hello,

    Right now my report show's date time like this: 10/23/2016 6:00:00 PM

    However it would be better to appear without the seconds, like this: 10/23/2016 6:00 PM

    I want to keep the datetime inside the same HTMLTextBox, I do not want to create a new control. Keeping it in the same control keeps the presentation tight together.

    My Expression looks like this: http://screencast.com/t/J0Rtv1z38

    What change should I make here?

    Can I put C# code here? {Fields.StartDateTime}.ToShortDateString() }

    I have read:

    http://www.telerik.com/forums/formatting-embedded-expressions

    http://docs.telerik.com/reporting/expressions-embedded

    But neither of these answered the question.

  2. Stef
    Admin
    Stef avatar
    3036 posts

    Posted 09 Aug Link to this post

    Hello Aron,

    You can use the built-in Format text function e.g.:
    ="htmlTextBox1 text {Format('{{0:MMM/dd/yy hh:mm}}',Parameters.Parameter1.Value)}"
    The curly brackets are escaped by doubling them.


    I hope this helps.

    Regards,
    Stef
    Telerik by Progress
    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
  3. DevCraft banner
Back to Top