Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
Solved

# Conditional Text in Crystal

Posted on 2016-09-27
Medium Priority
80 Views
I have a table in which I am writing a crystal report for.  Everything has been created in Crystal and this is the last step.  We have a field that gives a name which is linked in the table to a number.

The table would simply look like this:

Number|Name
1|     John
2|     Mike
3|     Bill
4|     Joe
5|     Bob
6|     Mike

In the Crystal Report only the Name field is showed in the details section.

Is there any way to have the text change to bold with asterisks if the name Mike comes up?

So it would look like this for example:

Joe
Bob
John
*Mike*

Additionally, is there any way to have a text box appear only next to the name Mike that would simply look like [!] for example.

Thank you for all your help,

Mike
0
Question by:Michael Graham
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• 2
• 2

LVL 35

Accepted Solution

James0628 earned 2000 total points
ID: 41819551
Are you literally talking about only the name Mike?  You show Mike twice in your "table" (as #2 and #6), so at first I thought that you were trying to highlight any name that was in the table more than once, but you didn't mention that.

Assuming that you are just looking for "Mike", you could create a formula (in the Field Explorer) like the following to add the "*"s and "[!]", and put that formula on the report:

``````if {Name field} = "Mike" then
"*" + {Name field} + "*   [!]"
else
{Name field}
``````

You could put the "[!]" in a separate text box, like you mentioned, but it's simpler to just add it to the name when you add the "*"s.  If you really want/need a separate text box for the "[!]", you could use logic similar to that above.  If you need help with that, let me know.

To make that field bold, right-click on the field, select "Format Field", select the Font tab, click the formula (X+2) button beside Style and enter a formula like this:

``````if {Name field} = "Mike" then
crBold
else
crRegular
``````

James
0

Author Closing Comment

ID: 41820961
Perfect! That worked! Thank you

Mike
0

Author Comment

ID: 41820963
sorry I should have mentioned the second formula is the one I used...However I like the first formula and I think I will be using it for future reports.
0

LVL 35

Expert Comment

ID: 41820978
You're welcome.  Glad I could help.

James
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
###### Suggested Courses
Course of the Month7 days, 1 hour left to enroll