?
Solved

crystal 10  coloring problem (red,yellow,green,blue)

Posted on 2004-10-08
5
Medium Priority
?
480 Views
Last Modified: 2006-11-17


 


I have 4 values of a field (osg_fbct_db_viewW_count.CountOftsname) the max value color needs to be Red,the least value needs to be blue.

the 2 values in between need to yellow and green.
its like red<yellow,green<blue

I coded::
if
{osg_fbct_db_viewW_count.CountOftsname} =maximum({osg_fbct_db_viewW_count.CountOftsname})
 then
     color(150,230,200)

else
 
    color(10,19,200)

its not working.....
0
Comment
Question by:manassahu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 42

Accepted Solution

by:
frodoman earned 2000 total points
ID: 12259750
Where are you putting this code?  What are you trying to accomplish?
0
 
LVL 28

Expert Comment

by:bdreed35
ID: 12260754
Add your field {osg_fbct_db_viewW_count.CountOftsname} to the report.

Right click the field, and choose format field.
Under the Font tab, click the x+2 button to the right of color, and enter the following logic:

if {osg_fbct_db_viewW_count.CountOftsname} = maximum({osg_fbct_db_viewW_count.CountOftsname}) then
    crRed
else if {osg_fbct_db_viewW_count.CountOftsname} = NthLargest(2,{osg_fbct_db_viewW_count.CountOftsname}) then
    crYellow
else if {osg_fbct_db_viewW_count.CountOftsname} = NthLargest(3,{osg_fbct_db_viewW_count.CountOftsname}) then
    crGreen
else if {osg_fbct_db_viewW_count.CountOftsname} = minimum({osg_fbct_db_viewW_count.CountOftsname}) then
    crBlue
else
   crBlack

The last else isn't necessary if you only have 4 values, but it is a catch all if there are any extra values.
0
 

Author Comment

by:manassahu
ID: 12260852
I go to section expert ,
click on the section header which has the field  CountOftsname),
then click on color
then put muy code in formula workshop..

This is the code I just ran

If ({osg_fbct_db_viewW_count.CountOftsname})=
Maximum ({osg_fbct_db_viewW_count.CountOftsname}, {osg_fbct_db_viewW_count.CY_CYCLE}) Then
     crRed
Else
    If ({osg_fbct_db_viewW_count.CountOftsname})=
Minimum ({osg_fbct_db_viewW_count.CountOftsname}, {osg_fbct_db_viewW_count.CY_CYCLE}) Then
     crBlue
Else
     DefaultAttribute

this runs well the O/p is

1.max value of  CountOftsname is showing red(which is ok)


2.Least value is showing Blue(which is ok)

Problem is::

3.ANything other than  max and min  is yellow...
The value after the max(immediate after max)  is yellow which is ok  and the value after that  i.e (immediate before min)has to be green but is yellow..

its like this
CountOftsname            color
44                                 red
34                                 yellow
7                                    green
1                                     blue


The green one is the problem..i dont know how to code it..
0
 
LVL 28

Expert Comment

by:bdreed35
ID: 12260883
This should do it for you:

If ({osg_fbct_db_viewW_count.CountOftsname})=
Maximum ({osg_fbct_db_viewW_count.CountOftsname}, {osg_fbct_db_viewW_count.CY_CYCLE}) Then
     crRed
Else
    If ({osg_fbct_db_viewW_count.CountOftsname})=
Minimum ({osg_fbct_db_viewW_count.CountOftsname}, {osg_fbct_db_viewW_count.CY_CYCLE}) Then
     crBlue
Else
    If ({osg_fbct_db_viewW_count.CountOftsname})=
NthLargest(2,{osg_fbct_db_viewW_count.CountOftsname}, {osg_fbct_db_viewW_count.CY_CYCLE}) Then
     crYellow
    If ({osg_fbct_db_viewW_count.CountOftsname})=
NthLargest(3,{osg_fbct_db_viewW_count.CountOftsname}, {osg_fbct_db_viewW_count.CY_CYCLE}) Then
     crGreen
Else
     DefaultAttribute
0
 
LVL 28

Expert Comment

by:bdreed35
ID: 12437411
Just out of curiosity, how did frodoman answer your question?
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question