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

Custom Coloring

Status
Not open for further replies.

gbrian

IS-IT--Management
Sep 22, 2004
96
US
I have a request to change the color of either the text or background color for the top 3 and lowest 3 items in a column.

Ex)
Column 1 Column 2
-------------------------
Brian 50%
John 40%
Joe 30%
Jane 10%
Mary 5%
Beth 10%

On this, I would like to indicate the highest values with a color of RED and the lowest values with a color of GREY.

Currently I am using a crosstab for this data. However, if it is impossible (As it seems to be) with the crosstab, is there any way I can accomplish this some other way? I am open to ideas--if there is a way I could create a cross-tab by hand with formulas etc and accomplish this, it would work for me.

Let me know if you have any ideas!! I'm using Crystal Reports 10.

Thanks in advanced.
 
If you are willing to do a group sort on this so that the records are in order of the summary value, then you could color the summary fields by doing the following. First select the crosstab and go to report->group sort and choose "all" and the summary field. Then select a summary cell->format field->suppress->x+2 and enter:

whileprintingrecords;
numbervar x := x + 1;
false

Then go to the border tab->color->background->x+2 and enter:

whileprintingrecords;
numbervar x;
if x in 1 to 3 then crRed else
if x in distinctcount({table.name})-2 to distinctcount({table.name}) then
crGray else
crNocolor

...{table.name} is your row field.

-LB
 
Okay, that sounds great--I will give it a try.

Is there any way to do it for each cross-tab column? Obviously you cant have each column sorted...
 
Please explain what your column field, row field, and summary are, including the contents of any formulas you are using for these. How many instances are there of the column field? Please provide the names of a few instances.

So now you are saying you want to show the top 3 and bottom 3 in individual columns? It would be easy to color values that fell below or above a certain amount anywhere in the crosstab, but what you are suggesting would be complex, I think.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top