Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Multiple Choice and Hidden Reports Expand / Collapse
Author
Message
Posted Tuesday, March 12, 2013 6:13 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Tuesday, May 7, 2013 3:30 AM
Points: 62, Visits: 155
On Report Builder 3.0 I have created 6 reports that are hidden unless it is selected in a parameter:

Report Code Visibility string:

=iif(Parameters!WhichReport.Value(0) = "Occupancy", False, True)

But what I want to do is make the Parameter a multiple select parameter so someone can choose two charts instead of 1 or choose all 6 etc but whatever selection is made all other reports need to stay hidden. Can this be done and if so how?

Thanks

Wayne
Post #1429728
Posted Wednesday, March 27, 2013 1:13 PM
SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Tuesday, November 25, 2014 7:27 AM
Points: 610, Visits: 2,139
The only way I thought of is definately a ugly workaround. I usualy pass multi values parameters to reports, not use them in the report itself.

You could pass your MV parameter to a db Stored Proc as a string using =Join(@ParamName.Value,",")
Then in the SP split the values into a result set and return that.

you'd start with "value1,value2,Value3"
and get as a dataset
Value1
Value2
Value3

Then use those values to control your Visibility.

Post #1436123
Posted Sunday, March 31, 2013 10:26 AM
UDP Broadcaster

UDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP Broadcaster

Group: General Forum Members
Last Login: Friday, October 24, 2014 9:55 AM
Points: 1,485, Visits: 1,036
One thing off the top of my head. The Join function will create a string of selected values.

Put this in each sub report definition.
=iif(Join(Parameters!ReportParameter1.Label,",").Contains("Occupancy"),False,True)


One thing to note.
All Sub reports will "fire" even if you do not have the visble flag set to true. Meaning the queries for all 6 reports will execute.
One way to cheat is add a parameter that the proc will use if its "false" then it will return an empty recordset that executes immediatelly. Or if your passing a daterange to the subreport make the endDate before the startdate, and it will execute immediatelly and return no rows. Make sense?
Post #1437301
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse