Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: SSRS
HI to all
 
please let me know how i change the cell color that based on some condition
 
for example :
 
if(startday =enddate ) then employnamee = red
 
means if startd day = end date then employee name come in red color other wise black.
 
i have search some code in google but not find relvent because my conditonal and value field are different please help me on this
Posted 4-Dec-12 6:17am
balongi1.1K

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

try the following in cell background property
 
=IIF(Fields!Column.Value = "Approved", "Green", "No Color")
 
in your case it should be
 
=IIF(Fields!startdate.value=fields!enddate.value,"Red","No Color")
  Permalink  
Comments
balongi at 4-Dec-12 12:25pm
   
but if start date is equal to end then i want to change the color for employeename
if i use avobe statement it change the color of startdate
Member 9581488 at 4-Dec-12 13:13pm
   
I think for that You have to write custom code(function) to check the conditions for equality of dates and then assign color code for empName cell.
 
Or else You can have one hidden field and assign true or false based on startdate== enddate. then use the hidden field value to change color of empname cell
balongi at 5-Dec-12 0:09am
   
Hi can you make a custome code for that because i am not aware with syntax please help me on this
Member 9581488 at 5-Dec-12 9:14am
   
Create one hidden field. Write this following in its expression
=Iif(Fields!startDate.value =Field!EndDate.value, true, False)
 
In emp Cell
 
=IIF(Fields!HdnField.value = true,"red","No Color")
 
Try this first. If it does not work then I will surely help for writing function.
The above solution is the shortest and easiest way.
Member 9581488 at 7-Dec-12 8:50am
   
=IIF(Fields!startdate.value=fields!enddate.value,"Red","No Color")
write this in emp cell.
it will work

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 340
1 OriginalGriff 250
2 DamithSL 170
3 Kornfeld Eliyahu Peter 130
4 Peter Leow 95
0 OriginalGriff 7,315
1 DamithSL 5,199
2 Sergey Alexandrovich Kryukov 4,917
3 Maciej Los 4,866
4 Kornfeld Eliyahu Peter 4,514


Advertise | Privacy | Mobile
Web03 | 2.8.141223.1 | Last Updated 4 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100