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!

How do you supress a background colour?

Status
Not open for further replies.

McNab

Programmer
Jul 23, 2001
101
CA
Hey,

I have a report that has fields which only get printed if they meet the conditons on it. It appears that the conditions are not met for this field as it comes out blank. However, the back ground colour for the field is grey. I am still getting the grey back ground to come in even when there is nothing else in the field. How do you make it white if it fits the conditions?

Thx

Jamie in Canada
 
Select the field, click format text, go to border, check in Background and enter the Format Formula :)
 
Thx ... but ...

What do you mean by the "format formula"

Could you please give me an example?

Is it something like this?

if IsNull{grey.field} then white

???????

thx

Jamie in Canada
 
Opps .. I spoke too soon!

Here is the formula:

*******************************
if IsNull{@total coverage}
then NoColor
else Gray >>>> Grey?
*******************************

It gives me an error when I click Accept:

"The word 'then' is missing."

??? I've moved IsNull around and the {@total coverage} but nothing, same error? Any suggestions?

Also, Ken...you told me is was "Gray", maybe is this dumb but I thought it was "Grey"? Who is right? Probably you! I don't get an error for the word or anything, but I'm not sure if the code is getting executed yet?

Thx again

Jamie
 
I figured it out ... thx anyways guys.

I was missing brakets.

if IsNull ({@total coverage})
then Silver
else NoColor

and it wasn't grey, it was silver

thx again

Jamie
 
Well ... it seems to work or at least the code is getting executed because when I had it as "Gray" instead of "Silver" I could tell because the back colour was darker. But it is still doing it? It only seems to happen once as this field is in the report many times. It will be blank or Silver back with text but then in the middle of it it still prints a silver field with no text? After it happens it seems to be fine again? So, it's only happening once in the middle of the report? Any ideas and or suggestions would be very helpful!

Thx

Jamie
 
Maybe the value isn't always null, but stores a "" or a space character. Try:

if IsNull ({@total coverage}) or
{@total coverage} in ['',' ']

then Silver
else NoColor Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Once again ... Thx Ken,

I had to flip it though...

then NoColor
else Silver


Jamie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top