Hi!
I have an annoying problem. I need to apply a background colour to all Customers whose name contains the letter "e" and I just can't figure out how to do it.
Any ides??
Right click on the string field and click border and colors. Then click on the X-2 button to the right of Background Color and enter the following formula:
If InStr({stringfield},"e"<>0 then gray(or whatever color you desire) else nocolor.
InStr returns the number of the first appearance of the second string in the first string, or zero if the string is not found. You can also make the second argument a multi-letter string. Software Support for Sage Mas90, Macola, Crystal Reports, Goldmine and MS Office
Thanks so much - it was the <>0 that I was missing. Could you explain why I need this? I kept getting an error = "Formula result must be a number", but was unsure of how to workaround it!
the InStr function returns a number so you must have a boolean that has a number in it. It is similar to a type mismatch error. Imagine a formula {Datefield}="ABC". You would get an error. Software Support for Sage Mas90, Macola, Crystal Reports, Goldmine and MS Office
Some formulas require the use of If-then-else (eg. background color, borders etc.)and some just require a statement (eg. conditional suppress)
In looking at the different cases...where there is more than one choice an if-then-else is required...but in suppress there is only the one choice (ie. to suppress the field)
Also I noted in earlier versions (not sure that it applies in 8+) Not only did you have to use this formula but also you had to check off the box with a selection. With the conditional suppress you didn't have to check the box...you just had to enter the formula
not sure if this helps you....just one of the many Crystal oddities you learn with time
Thanks Ngolem!
I have been using Crystal reports for over five years, and am used to its oddities, but this one was a real headache! Nothing in the help about it either!
Thanks again for replying.
Justine
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.