Link to home
Start Free TrialLog in
Avatar of Martin Griffiths
Martin Griffiths

asked on

How to insert a boolean function in to the coding of an ssrs report

I'm trying to change the background colour of a cell in a table of a 3-table report dependent on it's content. Basically if it contains "fail", "failure", "failed"  or "not sent" I want the background to be red.

If I did a nested IIF statement to cover each of these it would become unwieldy and unmanageable. Found some suggestions to do a function in custom code in the report properties, but I'm not that good on vb.net code and there's no intuitivism in the code box to be able to build it easily. Is anyone able to help please?
ASKER CERTIFIED SOLUTION
Avatar of sammySeltzer
sammySeltzer
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Personally I would do that in SQL (UDF or SP) to return extra colum "color" then just use expression =Fields!Color.Value in the background property. It will be more reusable, maintanable + better performance.

Regards
Emil
SOLUTION
Avatar of Howard Cantrell
Howard Cantrell
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Martin Griffiths
Martin Griffiths

ASKER

Thanks both. Wasn't aware of switch which I will use from now on, although, understanding the custom code functionality too was a side-purpose of this question so have shared the points between you.