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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formatting based on contents of field? 1

Status
Not open for further replies.

Davest11

Programmer
Oct 26, 2004
82
US
I'm using Crystal v10. My customer wants negative fields to show up in red on her report. I know that I can go into each of the many fields and conditionally format the field based on the value of that particular field - very time consuming with many fields in many reports. What I'm wondering is if there is a reserved word that refers to the contents of a field, or another straightforward of accomplishing this that I'm missing. A way to change the color of the field when the field is negative that will work across all fields, without referring to that specific field in the code.

Thanks!

-Dave
 
Have you used the Highlighting Expert? That is one quick way to apply the conditions you want.
 
Looks like that's the "straightforward way of doing this" that I was missing. :) Thanks!

-Dave
 
You could also select all of the fields that you wish to format, click the Format button, and on the Font tab, enter the following code in the color X-2 button:

If CurrentFieldValue < 0 then crRed

The benefit to using this method over the Highlighting Expert is that you have more control. For example, in the future you may want to compare CurrentFieldValue to a parameter or a variable. This cannot be done using Highlighting Expert.


Bob Suruncle
 
Yes...thanks, Bob! That's exactly what I was looking for. I figured that there had to be a reserved word along the lines of CurrentFieldValue, but I wasn't finding it.

-Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top