Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RDLC Switch Construct - is there an Else?

I have the following expression within a report:

= Switch( Fields!RATE_CODE.Value = "First", " £/Week",
          Fields!RATE_CODE.Value = "Second", " £/Day")

I've searched all over but cannot find a way to add an else or default to this expression. There doesn't seem to be any doc's on this contruct either.

Is this possible?

like image 812
m.edmondson Avatar asked Jun 21 '12 09:06

m.edmondson


1 Answers

The Switch function returns the value associated with the first expression in a series that evaluates to true, you can use the following trick:

= Switch( Fields!RATE_CODE.Value = "First" , " £/Week",
          Fields!RATE_CODE.Value = "Second", " £/Day",
          1 = 1                            , "default value" )
like image 109
Marek Grzenkowicz Avatar answered Nov 08 '22 19:11

Marek Grzenkowicz