Reputation: 219
I am working on ssrs, and i am new to this. My problem is that I have a data set that has result detail of a student, containing subject and sub subjects. I want to display the record of first subject "English" then detail of its sub subject "Writing", "Reading", "Listening" etc, than record of second subject and detail of its sub subject, and i have done it. But now i want to assign each subject a specific color, like red for English, green for Mathematics, i have use matrix control to display the record
Upvotes: 0
Views: 31
Reputation: 12243
You have two options:
Either use the switch
expression in the background color
property, which returns the value after the first condition that returns true
:
=switch(Fields!Subject.Value = "English", "Red", Fields!Subject.Value = "Mathematics", "Green", TRUE, "NoColor")
You put the TRUE
at the end so that if no condition is met, a 'default' value is returned rather than an error.
Alternatively, you can save the colours in your database against your subjects or calculate them using a case statement in your dataset query and then simple reference that field in the background color
property:
=Fields!SubjectColour.Value
Upvotes: 1