February 16, 2021

Published February 16, 2021 by

DevExpress XtraReport : Text Expression for Concatenation of Date Range with Date Format and other String

This code example provides a way of concatenation of multiple fields/parameters/other string in a single control.

Here, startDate and endDate are two parameters of a Date Range.

We want to display these two parameters in a single XRLabel. The dates should be formatted as MMMM d, yyyy. It needs to concatenate two string "From" and "Through" so that it is displayed like this:

From January 1, 2021 Through January 31, 2021.

So what is the text expression?

Concat('From ' , FormatString('{0:MMMM d, yyyy}',?startDate), ' Through ', FormatString('{0:MMMM d, yyyy}',?endDate))




Read More