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

Colouring a Box component

Status
Not open for further replies.

StevenK

Programmer
Jan 5, 2001
1,294
GB
I am working on a crystal report that has shading for the detail band in instances when one of the report fields meets a particular criteria. Ideally I would like to change the colour of a Box component instead. I can see no direct way of doing this - can anyone make any suggestions how I might achieve this ?
Thanks in advance.
Steve
 
StevenK: As there is no conditional formatting of Box components directly you'll have to resort to the old programmer's trick of having 2 versions of the line containing the box using sub sections. You can then suppress one or other of the subsections under logical control David C. Monks
david.monks@chase-international.com
Accredited Seagate Enterprise Partner
 
If you are attempting to put a box around a field, right click on that field and choose 'border and colors from the drop-down menu.

In the Line Style section, make the Left, Right, Top and Bottom equal to single, this will give the effect of a box.

Then in the color border section, check the 'background' tick box and choose the colour you require.

Or - if you just want to fill a box object with colour, draw the box and right click on one of the sides to invoke the drop-down menu. Choose 'Format Box'. In the Fill section check the 'color' tick box and choose the desired colour.

HTH

Steve Chapman
 
You can put two formulae on top of each other, one with a green background (or border) and one with a red (for example).
The first formula should contain
"if condition then file.field"
The second formula should contain
"if not condition then file.field"
In all cases one of the formulae will be blank (or zero) and so will not display, letting the other one show through.
If it is a numeric field you have to have the "suppress if zero" option switched on. You may need another formula if zero is a valid value. I have used this to display negative figures with a red background, zero with yellow and positive with green.
 
Thanks for the help and pointers people. It is the actual box that I wanted to change the background colour of (it contains a number of database field objects and formula) - so all components in the box have the same colour acordingly.
Doesn't sound as though there's a direct approach to this so may need to resort to setting up two detail sections and suppress/show the required one accordingly.
Steve.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top