Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change textbox depending on boolean parameter choice in SSRS

I have a report that holds two tables, one is for a Detail report and the other a Summary report. I've set it where if the Summary parameter (a boolean) is set to true then you only see the Summary table and vice versa if it's set to false. But I have a text box in the header that reads Report (Detail). I would like this text box to change depending on the same parameter, so if the summary parameter is set to "true" then the textbox will read Report (Summary) and if set to false it will read Report (Detail). How can I write this expression, I've searched but found nothing other than mentions of IIF expressions but I'm new to SSRS and don't know how to write these off the top of my head yet. Sorry if it has been answered I just couldn't find it.

This is how I have the expression for my Details visibility table to show if the Summary parameter is false (I found this out online too):

=IIF(Parameters!IsSummary.Value = 1, True,False)
like image 337
Rodney Maspoch Avatar asked Jun 03 '13 17:06

Rodney Maspoch


2 Answers

I believe you get rep for selecting an answer (I also gave your question an upvote)

=IIF(Parameters!IsSummary.Value = 1, "Report (Summary)", "Report (Detail)")

The basic structure of the Iif is:

Iif(<equality>,<do this when true>, <do this when not true>)
like image 174
Ben English Avatar answered Nov 19 '22 14:11

Ben English


this is more compact
beacuse if is boolean, you don't need the equivalence.

=IIF(Parameters!IsSummary.Value, "Report (Summary)", "Report (Detail)")
like image 36
Mattia Caputo Avatar answered Nov 19 '22 13:11

Mattia Caputo