Using “Transparent” option in SSRS, and prevent the ‘Not a Valid BackgroundColor’ Error
In SSRS, if you’re building an expression to manage, for example, the background colour of a cell / shape, it’s easy to fall into the ‘Transparent Trap’
When building an expression, it’s easy to use the expression builder to add constants and built-in values.
This is particularly true of the colour pallet, given you need to know the specific colour names
The problem however if when you want to use a ‘No Color’ background.
Double clicking the ‘No Color’ value from the Pallett will insert “Transparent”
However, when you go to run this, you may receive the following warning…
Note: The warning will only generate if, after evaluating the statement, it needs to invoke the “Transparent” – ie, you won’t get the warning until it actually tries to use this colour – if your expression nearly always evaluates to a different colour, you may never see the warning.
Now, this warning isn’t going to break your report – you will get the correct result – but if you want to clear the error you simply need to go back to the expression editor, and replace “Transparent” to ‘Nothing’ (no quotes)
Your expression will now evaluate without generating a warning (remember, there’s a long-standing bug in SRSS whereby a warning won’t disappear until you restart the application, so don’t be alarmed if it’s still there to begin with)
And that’s it.