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

Color code range values

Status
Not open for further replies.

staceyn

Technical User
Nov 19, 2004
107
US
Hello,
I am using crystal pro 10 with an informix database.
I am creating a receiving flow report for a customer.
What they would like to see is all PO's with units received in a given month. That part is pretty easy to do. I have 12 formulas per month.
A formula example for April's receiving is:

if {po_detail.pd_rec_date}in Date (2005,04 ,01)to date (2005,04 ,30) then {po_detail.pd_sizetot}*{po_detail.pd_cost}.

The report layout looks something like this:

item descrip cost retail January February
units cost po# units cost po#
101703 Keyring 1.50 5.00 5 7.5 4232 10 15.00 4432
4315 4222
4872 4315
4315 4222

102029 Hat 6.00 18.00 4 24 4275 5 9.00 4872
4232 4275


What we want to accomplish is color coding by PO number. (In the example below, the colors aren't important and there will be a maximum of 10 PO's per item per month)

So in the example above for item 101703 information on po 4232 would show in red, info for 4315 would show in blue, 4872 would show in green.

Does anyone know of a way to accomplish this?

thanks in advance for any help


 
If you want to color an entire row based on PO#, then go to the section expert->details->color->background->x+2 and enter soemthing like:

if {table.po#} in 4200 to 4299 then crRed else
if {table.po#} in 4300 to 4799 then crBlue else
if {table.po#} >= 4800 then crGreen

If you want to do this just for the po field, then right click on the field->border->background->x+2 and enter the formula there. Or if you want to change the font color, go to the font tab->font color->x+2. If you want to change the font of all fields in the row, select all fields and add the formula to the font color field format formula area.

If you want to more specifically adjust the color values, you can use the following instead of crColors:

color(r,g,b)//where r, g, b are numbers from 0 to 255

-LB
 
LB,
I have done the basic color coding before, so that isn't the issue. The PO numbers will be ever changing from month to month, so I can't hard code colors to specific ranges of PO numbers. I have a formula that will find all of the PO numbers in a given month.I just need to find out how to color code the two formulas only based on the PO numbers in a given month.
I thought I could do some kind of minimum/maximum value, but I can't seem to get that to work.

Thanks
 
Why not use the minimum/maximum?

And you should post what you tried rather than "I can'tseem to get that to work".

And this formula "I have a formula that will find all of the PO numbers in a given month"?

I would think that you could break it into 1/3 if that's what you want using something like:

numbervar PoRange:=maximum({table.po},-minimum({table.po});
If {table.po} >= minimum({table.po})
and
{table.po} <= minimum({table.po})+(PoRange*.33) then
crred
else
If {table.po} > minimum({table.po})+(PoRange*.33)
and
{table.po} <= minimum({table.po})+(PoRange*.66) then
crblue
else
cryellow

Should get you close...

-k
 
I cannot tell what your rules are for coloring the po#. What are the colors meant to indicate???

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top