Search code examples
teleriktelerik-reporting

How to display fields in new line in same textBox in telerik reporting?


I am using Silverlight4 and Telerik Reporting Q3 2011. I am trying to Generate Reports of all Outlets. I used Table to display its fields. And I want to Display Full Address in same cell. How could I?

I Used following Experession to display Full Address in same cell.

 = Fields.AddressLine1
 + ", " + Fields.AddressLine2
 + ", " + Fields.Suburb
 + ", " + Fields.City
 + ", " + Fields.State
 + ", " + Fields.Country

I want do display this in same cell but want output like below..

 =====================
   Address
 =====================
  15A,
  xxxx xxxRoad,
  xxxxxx,
  xxxxxxxx
 ====================

But I m getting this

 =====================
   Address
 =====================
  15A, xxxx xxxRoad, xxxxxx, xxxxxxxx
 =====================

How do I get Output Which I want?


Solution

  • made the Function NewLineFeeds() in this function I used Replace() Method to replace the specific string to newLine(\n) .

    public static string NewLineFeeds(string text)
    {
        string result = text.Replace(", ", "\n");
        result = result.Replace(", ", "\n");
        result = result.Replace(", ", "\n");
        return result;
    }
    

    and my Expression is

     =NewLineFeeds(Fields.AddressLine1 
      + ", " + Fields.AddressLine2 
      + ", " + Fields.Suburb 
      + ", " + Fields.City 
      + ", " + Fields.State 
      + ", " + Fields.Country)
    

    This call the Function NewLineFeeds() and replace ", " to \n (new Line). Add this will work Fine..