Link to home
Start Free TrialLog in
Avatar of freeflight123
freeflight123

asked on

change color of details row

Hi,

how can I change the color of a details row, e.g. if
table.created=NOW() then the whole row should turn into red
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mike McCracken
Mike McCracken

In CR7 the date is CurrentDate()

mlmcc
I concur with mlmcc, but because of a Crystal "quirk" be sure to add an "else" to this particular formula (or the entire background will black out, so:

v8 or higher
If ({table.created} = CurrentTime()) then
 red else defaultattribute

v7
If ({table.created} = Currentdate()) then
 red else white

(or I think v7 included "nocolor" also)
Hi.

Depends what you mean in "turning red":
- if changing background for detail section see mlmcc's comment above
- if changing background for part of the section see my comment at https://www.experts-exchange.com/questions/20723536/Formating-Issue.html
- if changing font (but not background): create a formula that returns color and use the formula in Format/Font?Color for each field in the detail section.

By the way, Now and CurrentTime are identical, but Now is provided for backward compatibility. Better use CurrentTime.
Also, I doubt that timestamp when you're running a report could be equal to any timestamp in the database. But it depends of the task too...

Good Luck.
PW
Thanks Pat.  Didn't know that since I haven't used that feature much.  I believe I used in a couple of reports so I'll verify you are correct.

mlmcc
Avatar of freeflight123

ASKER

thanks guys, works!
how can I have it in e.g. #FFCCCC instead of red?
Hi.

Sure, you can. Use Color(r,g,b), where r,g,b are bytes. As well you can create a function that converts hex values to bytes. :-)

Good Luck.
PW
Glad I could help

mlmcc