SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


How to update a column value based on other columns background color?


How to update a column value based on other columns background color?

Author
Message
zxu1
zxu1
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
Points: 2 Visits: 96
Can someone help out this issue? I am using SSRS 2008 R2

I have a table
col1 col2 ol3 col4
row1 bg color "red" bg color "red"
row2 no color for all three columns
row3 bg color "red"

I want to update col4 = 1 as long as any one of the column at the row has background color = "red". So it means I want to update col4 like:
col4
row1 1
row2 0
row3 1

Thank you.
Rob Taylor
Rob Taylor
Hall of Fame
Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)

Group: General Forum Members
Points: 3828 Visits: 1616
Are you conditionally setting the cells background color? Something like:

=IIF(Fields!Amount.Value < 0, "Red", "Green")

You could use the same type of expression to set the value of your column 4.

HTH,
Rob
zxu1
zxu1
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
Points: 2 Visits: 96
Thank you for your response.

Yes I conditionally setting the cells background color using swich. Since there are more than 70 columns, each column has complicated condition to get background color, I would like use the color result to update this column value.

Another question is hidding property.

I tried to hide a row as long as any columns in this row has background color = "yellow". It doesn't work if using statement as
IIF(fields!col1.backgroundcolor = "Yellow", true, false).

Can you help?

Thanks again.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search