BOFocus – Crystal Reports Tips – Tricks – Tutorials

Crystal Reports - Formulas

Fading background color

The following example was lifted from tek-tips.com. The example shows to to change the background color of a report from a solid color which than fades to a lighter color.

Following formula goes in the report header:

WhilePrintingRecords;
NumberVar CounterX := 0;
NumberVar CounterY := 255;
NumberVar CounterZ := 255;

Following formula in the detail section:

WhilePrintingRecords;
NumberVar CounterX;
NumberVar CounterY;
NumberVar CounterZ;
NumberVar IncrementValue := 5;
If CounterX + IncrementValue >= 255

Then
If CounterY – IncrementValue < 0
Then

If CounterZ – IncrementValue < 0
Then CounterZ := 0 Else
CounterZ := CounterZ – IncrementValue Else
CounterY := CounterY – IncrementValue Else
CounterX := CounterX + IncrementValue;

Conditional Colour in Details:

Color(NumberVar CounterX,NumberVar CounterY,NumberVar  CounterZ)

Tagged , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

GET SOCIAL

QUICK TIP

The options available in the Format Editor are dependent on the type of field that is being formatted.

ADVERTISMENT