Solved

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

Posted on 2004-10-08
5
468 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
  • 3
5 Comments
 
LVL 42

Accepted Solution

by:
frodoman earned 500 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

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…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

707 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now