Crystal Reports & SQL Reporting Services Training Consultants
Account Log in:
Username:
Password:
Believe in yourself so others will too
 
Institute of IT Trainers - Freelance Trainer of the Year 2006 & 2009
Liverpool Business Connect Member
  Maximum Impact Solutions Limited - Reporting Solutions, Creating Answers
Reporting Solutions - Creating Answers, Crystal Reports, Dashboarding (Xcelsius) & SQL Reporting Services

The Maximum Impact Solutions Blog Feed ME!!!!

19
September

How Do I Convert Text to Sentence Case in Crystal Reports? - Amendment

This is a follow up post I did last year "How to display a text field with various cases to sentence case?"

When I wrote the blog post, it worked, it was a little to simplistic, as it converted every first character to upper case in a text field.

So I thought I would modify it, to do this with the exception of the words And, For, To and The contained within the text field.

Solution:

The formula then becomes:

IF " And "  in CSTR(PROPERCASE({Tablename.Fieldname}))
THEN REPLACE ( PROPERCASE({Tablename.Fieldname}), " And ", " and ")
else
IF " For "  in CSTR(PROPERCASE({Tablename.Fieldname}))
THEN REPLACE ( PROPERCASE({Tablename.Fieldname}), " For ", " for ")
else
IF " To "  in CSTR(PROPERCASE({Tablename.Fieldname}))
THEN REPLACE ( PROPERCASE({Tablename.Fieldname}), " To ", " to ")
else
IF " The "  in CSTR(PROPERCASE({Tablename.Fieldname}))
THEN REPLACE ( PROPERCASE({Tablename.Fieldname}), " The ", " the ")
else
PROPERCASE({Tablename.Fieldname})


If you have any questions, leave us a comment below, or need any assistance, please do not hesitate to Contact Us

MAKE A COMMENT

Name *

Email Address *

Comment *

To prove you are human what is:

27 + 93 =