Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Analysis Server and Reporting Services (2005)
 SSRS 2005 Color Expression

Author  Topic 

Makaio780
Starting Member

24 Posts

Posted - 2012-07-31 : 12:17:12
Could someone tell me why this expression does not work and i have i could achieve something like it.

=IIF(Fields!Customer.Value = FIRST(Fields!Customer.Value, "ds_Top10Prev2"),"Red","Black")

Ron Cheung

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2012-07-31 : 13:11:41
That expression seems perfectly fine to me. The only reason I can think of that it does not work is if the data type is float and there is some kind of rounding error.
Go to Top of Page

Makaio780
Starting Member

24 Posts

Posted - 2012-07-31 : 13:18:24
What im trying to do is compare names from 2 datasets. Example if Name in dataset 1 exists in dataset 2. to color red if not then color black.

Thanks for the quick response.

Ron Cheung
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-07-31 : 13:18:47
actually that expression doesnt make much sense. it just makes first values color alone red. is it that you want?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2012-07-31 : 13:21:37
I tested it and it seems to work fine.

Visakh I think what s/he is trying to do is to color all the rows that match the first row in red and have the others as black.

I tested it with two data sets, tested it with floating point and character data types - all seem to work fine.
Go to Top of Page

Makaio780
Starting Member

24 Posts

Posted - 2012-07-31 : 13:30:55
hmmm k one more example:

Dataset 1
Ron
Tim
Jon

Dataset 2
Jeff
Ron
Kim

If a name in dataset 1 matches a name in Dataset 2 then Color Red if not color black.

Sorry for being confusing.

Ron Cheung
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-07-31 : 14:18:33
quote:
Originally posted by Makaio780

hmmm k one more example:

Dataset 1
Ron
Tim
Jon

Dataset 2
Jeff
Ron
Kim

If a name in dataset 1 matches a name in Dataset 2 then Color Red if not color black.

Sorry for being confusing.

Ron Cheung


you cant compare between dataset fields like that inside SSRS

if thats the case why not apply the logic in query itself and then bring it as a single dataset with matching bit also?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -