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

CR9 - Cross tab background color based on heading 1

Status
Not open for further replies.

CalgaryCR9

Technical User
Aug 12, 2005
80
CA
I'm using Crystal Reports Version 9.

My crosstab looks like this:
Column 1 Name Total
Column 2 Name (total suppressed)
Column 3 Name (total suppressed)
Row 1 Name {serv_call.serv_call_id}

I don't want to highlight a particular value, but want the columns to be a particular color based on the Priority.

I want columns background colours to be based on a similar formula (note: {SERVICE_CALL.SVC_CALL_PRIORITY}=Column 1 name:

if {SERVICE_CALL.SVC_CALL_PRIORITY}="URGENT"
then color (255,0,0 )
else
if {SERVICE_CALL.SVC_CALL_PRIORITY}="HIGH"
then color (72,118,255 )
else
if {SERVICE_CALL.SVC_CALL_PRIORITY}="MEDIUM"
then color (0,205,0)
else if {SERVICE_CALL.SVC_CALL_PRIORITY}="LOW"
then color (156,156,156)


What do I need to do? I can find tons of info on highlighting a particular value but not highlighting a column based on it's header.

 
To highlight the label, use a formula like:

if currentfieldvalue = "URGENT" then
color (255,0,0 ) else
if currentfieldvalue ="HIGH" then
color (72,118,255 ) else
if currentfieldvalue ="MEDIUM" then
color (0,205,0) else
if currentfieldvalue ="LOW" then
color (156,156,156)

To highlight the inner or total cells, use a formula like:

if gridrowcolumnvalue("SERVICE_CALL.SVC_CALL_PRIORITY") = "URGENT" then
color(255,0,0) else
if gridrowcolumnvalue("SERVICE_CALL.SVC_CALL_PRIORITY") ="HIGH" then
color(72,118,255) else
if gridrowcolumnvalue("SERVICE_CALL.SVC_CALL_PRIORITY") ="MEDIUM" then
color(0,205,0) else
if gridrowcolumnvalue("SERVICE_CALL.SVC_CALL_PRIORITY") ="LOW" then
color(156,156,156)

-LB
 
That's so darned close, but not quite what I was after.

My cross tab ends up looking like:

URGENT HIGH MEDIUM LOW
unix cisco unix cisco unix cisco unix cisco
1 0 3 1 13 29 4 0
6 9 4 5 7 13 4 6
and so on

I want all of first two columns (Urgent/Unix/Cisco/numbers) to be red, all the 3rd & 4th columns to be blue, and so on.

Thanks.
 
Just tested the above and if you applied the above to the priority labels and the inner cells and totals, then all you still need to do is to apply the second formula to the labels for unix/cisco--without any changes to the formula.

If you continue to have an issue, you need to specify the results you are getting that differ from what you would like to get.

-LB

 
I did that. It looks ok, but what I was hoping for was the entire cell/column to be colored, not just the small area around the text.

From what I'm researching, that's not do-able.

Joy

PS..thanks again for all your help.
 
I think the only way to achieve that is to go into the customize style tab in the crosstab expert and uncheck "show cell margins". This does give the crosstab a cramped look, however. You might consider coloring the font instead of the background.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top