[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

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

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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

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 tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

656 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