Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bold, Italic and changing font color for certain fields 3

Status
Not open for further replies.

beammie

Technical User
Mar 4, 2003
13
US
I hope this is the correct forum....

CR v7

Is it possible to have CR do different things for fields that meet a certain criteria?

For instance: I have a staff directory that is run from our Exchange Server. We would like to have all the MGR's names bolded, Director's in italics, and Volunteers font a different color. There is a field that categorizes each of these individuals on our Exchange Server but I do not want the field to show in the report (just name, dept, and telephone number.)

I would appreciate any help anyone can give me. I am sure it is something quite simple, I am just unable to figure it out.
 
hi
Yes it can be done
example
in a formula
on the field {manager}
right click on that field and in the font style
click on the x2 and insert this condition
-------------------------
if
{mamager} then CRBold
else
if
{Director} then CRItalic
else
if {Volunteers}then CRRegular
------------------------
NOW FOR COLOR FONT
you will go the windows of font and in the section COLOR
click on the x2 and type this
-------------------
if {Volunteers} then Red

----------------------

or what color you prefered type it in

hope this helps you

pg
 
Hey pg .....

I can not thank you enough for responding to my question!! This is an issue that three of us have been working on forever... Argh!

I don't want to take up your time but can I bother you one more time..?

I tried what you gave me but the formula keeps giving me an error needing a boolean at the CRBold.

I'll explain real quick what we have:

Departmental Listing with Name, Dept and phone number:

FIELDS: Last Name
First Name
Phone Number
added field not to show on report: Office Location

(Under the FIELD "Office Location" this is where we have either, Management, Director, or Volunteer listed.)

If they have &quot;Management&quot; typed in that FIELD we want the entire line (lst nm, fst nm, and phone number) in <Bold>... and Dir <I>, Vol <Font Color Red> (Never showing the FIELD &quot;Office Location.&quot;

I added the FIELD &quot;Office Location&quot; to the report and right cliked on the FIELD went to Format Field, Font X2. Wrote the formula: if {Office Location}= 'Management' then CRBold. Error Booleon missing on CRBold.

I am so sorry about this but sure appreciate any help you can give us. We have been to numerous help sites but can not get an answer. Thank you, Thank you, Thank you
 
hi
looks like you have a problem here.

Under the FIELD &quot;Office Location&quot;
right click on that field and
under font style
click x2 and enter this
--------------
if
{Office Location} = &quot;Management&quot; then CRBold
else
if
{Office Location} = &quot;Director&quot; then CRItalic
else
if
{Office Location} = &quot;Volunteer&quot; then CRRegular
------------------------

try it works in crystal 8.5

if your using crystal 7 then read below
Conditionally formatting font face, style, or size

The information in the article refers to:
Seagate Crystal Reports 7


Applies to:

All versions
Conditional formatting a field to appear in bold
Using conditional suppression



Synopsis

How can you conditionally format a field to appear in bold?

Font attributes such as font face, style and size do not have the option to be applied conditionally

Solution

There is a workaround which creates the appearance of having a conditionally formatted font attribute.

This solution below refers to database fields and bolding, but it also works with text objects, formula fields, and parameter fields that you want to display with conditional font faces, styles, or sizes.

1. Insert another copy of the field to be bolded on to the report. Place the two copies side by side for now.

2. Right-click one copy of the field, and click 'Change Font'.

3. In the 'Style' box, click 'Bold'.

4. Go to the Common tab and click 'X+2' beside the 'Suppress' check box. This opens the Conditional Formatting Formula Editor.

5. Type the condition that needs to be met to suppress the bolded field. For example, you only want the bolded field to display if its value is greater than zero, so the suppression criteria is:

{database.field} <= 0

· Check and save this formula.
· Click OK to return to the report.

6. Right-click the other copy of the field, and click 'Change Font'.

7. In the 'Style' box, click 'Regular' if it isn't already selected.

8. Go to the Common tab and click 'X+2' beside the 'Suppress' check box. This opens the Conditional Formatting Formula Editor.

9. Type the inverse of the condition you specified in step 5. For example, you only want display the non-bolded field when its value is less than or equal to zero, so the suppression criteria is:

{database.field} > 0

· Check and save this formula.
· Click OK to return to the report.

10. Preview the report to make sure the conditional suppression is working as you intended - you will either see the bolded field, or the non-bolded field, but you won't see both of them at the same time.

11. In the Design tab of the report, move copy two of the field so it is directly on top of the original copy.

This field displays as if it was formatted with conditional bolding.






pg
 
IT WORKED!!!!! Finally an ending to this project!!!

Thank you so much pg! You have saved our sanity!

Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top