July 27, 2009 at 10:37 am
I've used the IIF/Switch statement before in doing alternating background colors, but this time is a bit different because the sequence values are not consistent. What i need is to alternate the colors for each change in the sequence field base on the sorting order. For example...
descr sequence
home 100
home 100
home 220
work 110
work 110
work 110
work 500
So in this case, home 100 would be color 1, home 220 would be color 2, work 110 would be color 1, work 500 color 2.
July 28, 2009 at 11:08 am
You might try to group the records by the decr and sequence and then do a MOD 2 to change the colors of the rows that way?
Or perhaps you could create another column in your dataset that increments by 1 for each change and then use a mod 2 of that... basically the same concept just a bit more behind the scenes.
-Luke.
July 28, 2009 at 11:33 am
I cant group it because the user needs to see all the details of each row (i didnt list all the columns). How do I increment for each change?
July 28, 2009 at 12:04 pm
nm, i figured it out. i thought you needed a group in the table for the below script to work but apparently not.....
=iif(RunningValue(Fields!descr.Value & Fields!sequence.Value,CountDistinct,Nothing) Mod 2, "lightBlue", "White")
July 28, 2009 at 12:09 pm
July 29, 2009 at 9:02 am
July 29, 2009 at 9:18 am
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply