Reputation: 137
How to convert Text on a SSRS report to Title Case. Right now I am using
=Strconv(Fields!Title.Value, 3)
Which works but in some cases eg.: GEORGIA(GA) is the text coming from DB its converting it to Georgia(Ga). I want it convert like Georgia(GA). I think some kind of Regular expressions need to be used, But I'm not sure how to do that. Is there a way to achieve this from a inbuilt SSRS functions or Writing custom method is the only way?
Any kind of help is much appreciated. Thanks! :)
Upvotes: 0
Views: 6960
Reputation: 39606
This will display GEORGIA(GA)
as Georgia(GA)
:
=StrConv(Left(Fields!Title.Value, InStr(Fields!Title.Value, "(") - 1), 3)
& Right(Fields!Title.Value, InStr(StrReverse(Fields!Title.Value), "("))
Basically it's splitting the string in two based on (
, applying StrConv
to the left side then concatenating the two strings back together.
Maybe not the most concise code ever but does the job with native SSRS functions.
Upvotes: 3