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

changing textbox value to title case

1 Answer 487 Views
Report Designer (standalone)
This is a migrated thread and some comments may be shown as answers.
Naureen
Top achievements
Rank 1
Naureen asked on 04 Apr 2019, 05:38 PM

how can i change my data to camel-case or proper-case (like first word of each letter to be capital) in text box, something like 

this is example -> This Is Example

1 Answer, 1 is accepted

Sort by
0
Silviya
Telerik team
answered on 09 Apr 2019, 08:29 AM
Hi Naureen,

You can create your own user-defined function where you can apply the logic for converting a string to camel-case or proper-case. For example:
[Function(Category = "My Test Functions", Namespace = "MyTestFunctions", Description = "Return Proper Case String")]
public static string ToProperCase(string text)
{
    var words = text.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)
         .Select(word => word.Substring(0, 1).ToUpper() +
                         word.Substring(1).ToLower());
 
    var result = String.Concat(words);
    return Regex.Replace(result, "(\\B[A-Z])", " $1");
}

How to create and use custom function is explained in User Functions help article.
Note that to use custom functions inside the Standalone Designer it needs to be extended - check Extending Report Designer help article for reference. The designer folder is placed in default Telerik Reporting installation folder, e.g. C:\Program Files (x86)\Progress\Telerik Reporting <VERSION>\Report Designer). 

Best Regards,
Silviya
Progress 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
Tags
Report Designer (standalone)
Asked by
Naureen
Top achievements
Rank 1
Answers by
Silviya
Telerik team
Share this question
or