ErickTreetops
ErickTreetops

Reputation: 3395

SSRS set background color of cell based on background color of another cell

I want a table cell in child row to take on the background color of the cell in the groupby row. It is possible to reference the text box which exists in the parent group and so i have used it in n expression to set the background colour of the child. e.g. Parent has background set to "red" in the Background colour of the child cell i added this expression =Fields!DerivedReportDate.BackgroundColor

it doesn't error but also ignores the statement and remaines with no color.

Anyone know if this is possible ?

ErickTreetops

Upvotes: 0

Views: 3034

Answers (3)

ErickTreetops
ErickTreetops

Reputation: 3395

ok. I decided it was too hard or possily impossible with to do this on the reporting services side so i ammended my SQL statement so that i got a 1 or 0 for each group and those child records associated to the group. Here is the query.

SELECT a.ServiceDriverServiceID, a.IndicatorName,b.ServiceDriverName,b.DerivedReportDate,b.Value,x.rowcolour from [dbo].[SLA_ServiceDriver_ServiceNames] a join [dbo].[FileShare_ServiceDrivers_Services] b on a.ServiceDriverServiceID = b.ServiceDriverServiceID and a.ServiceName = @serviceName join ( select derivedreportdate, (row_number() over(order by DerivedReportDate))%2 as rowcolour from [dbo].[SLA_ServiceDriver_ServiceNames] a join [dbo].[FileShare_ServiceDrivers_Services] b on a.ServiceDriverServiceID = b.ServiceDriverServiceID where a.ServiceName = @serviceName group by derivedreportdate

) x on b.DerivedReportDate = x.DerivedReportDate order by b.DerivedReportDate desc

I used 1 and zero's but could have made the rowcolour a case statement which returned the string equivalent of a colour depending on the row value.

Upvotes: 0

Shruti Kapoor
Shruti Kapoor

Reputation: 1136

This is a workaround - you could possibly make another field called BackgroundColor that accepts string values. You can set this in your code/database for the parent. Then, in the BackgroundColor property in Properties pane, enter the expression =Fields!BackgroundColor.Value. The you could use the same field for child by using Lookup expressions. Heres more about Lookup

Upvotes: 0

Eric Hauenstein
Eric Hauenstein

Reputation: 2565

This does not appear to be possible. http://msdn.microsoft.com/en-us/library/dd255285.aspx

If you have a reasonable number of groups, just match them manually. If you have an unreasonable number of groups, use the same conditional formula to modify the backgrounds of the groups at the same time.

Upvotes: 0

Related Questions