?
Solved

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

Posted on 2004-10-08
5
Medium Priority
?
482 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 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

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 …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

850 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