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

Format multiple data fields in one textbox

1 Answer 217 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kasper Schou
Top achievements
Rank 1
Kasper Schou asked on 29 May 2013, 07:09 AM
Hi Telerik,

Is it possible to have a single textbox display formatted values for multiple data fields? Specifically my issue is I want to display a date interval in the same textbox where the start and end dates are in two individual datafields of type DateTime, like so:

"01/01/2001 - 07/01/2001"

I want to utilize the localization and formatting capabilities of having the dates as DateTime types and therefore combining them in codebehind as a string is not an option for me, then I would rather have two separate textboxes - BUT having two separate textbox then present me with the problem of proper displaying in the report if the formatting changes (longer or shorter datetime string).

I was trying to do something like this:

=Format("{0:d}, {1:d}", Fields.FirstDistributionDate, Fields.LastDistributionDate)

Thanks in advance,

Best regards,
Kasper Schou

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 31 May 2013, 08:55 AM
Hi Kasper,

You can use the ToString function on DateTime values as shown in the following expression example:

=CDate("1.1.2013").ToString("d")+", "+CDate("1.3.2013").ToString("d")

Regards,
Peter
Telerik

Have you tried the new visualization options in Telerik Reporting Q1 2013? You can get them from your account.

Tags
General Discussions
Asked by
Kasper Schou
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or