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

Crosstab Cell Background Color Formula 1

Status
Not open for further replies.

JStandard

Programmer
Mar 15, 2005
22
US
Greetings,

CR Professional 9.2.14, SQL Server 2k, Investran Report Wizard, 3rd party viewer.

I've searched through the archives and couldn't quite find anything similar so...

I have a cross tab with the following output:

Vehicle Name
Strategy Fund Name
Vehicle 1 Vehicle 2 Total
Strat1 Fund 1 1.03% 2.40% 3.43%
Fund 2 2.00% -1.50% 0.50%
Total 3.03% 0.90% 3.93%
Strat2 Fund 3 etc
Fund 4 etc
Grand Total ... etc


The % cell contains a formula which does FundValue/Vehicle Value * 100, in the formula @FundPercentage.

I want to highlight all cells that have a negative value in them.

I've been trying the following in the "background" color of the %cell formula:
Code:
if (@FundPercentage} < 0 then
 crRed
else
 noColor
Which does not seem to work, it just highlights all cells red, which I'm assuming means if anyone of the cells is less than 0, it applies that to all cells.

I also slapped a whileprintingrecords; in front of it to no avail.

Is there a way I can highlight the individual cells of this crosstab that meet the criteria of "Value < 0" ?

Much appreciated,

Jeff.

 
Try
if CurrentFieldValue < 0 then
crRed
else
noColor

Bob Suruncle
 
Bob,

Just wow, I had no idea about CurrentFieldValue. That did the trick exactly!

I can apply that to other areas as well.

Thanks kindly,

Jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top