Groups | Blog | Home
all groups > sql server reporting services > october 2005 >

sql server reporting services : Passing a multi-value parameter to a Subreport


isaak
10/27/2005 2:38:08 PM
How do I pass a multi-value parameter to a subreport?

For example, if my main report has a multi-value parameter named @p1 and my
subreport's dataset is generated by SQL

SELECT a,b FROM MyTable WHERE a IN (@LongList)

how do I then pass the user-selected @p1 values from the main report to the
@LongList parameter in the subreport?

I tried specifying JOIN(@P1.Value,",") for a parameter value, but it did not
work.

Any help/suggestions will be appreciated. Thanks in advance
Bruce L-C [MVP]
10/27/2005 6:57:22 PM
This is just a guess based on what I know is going on behind the covers but
try the following. In your subreport make the Report Parameter @LongList a
multi-value parameter. Test the subreport stand alone and make sure it
works. Then drop the subreport into your main report, right mouse click on
it, parameters and map the report parameter from the subreport to the report
parameter from the main report. You should not have to do anything fancy.

Let me know if it works.


--
Bruce Loehle-Conger
MVP SQL Server Reporting Services

[quoted text, click to view]

isaak
10/28/2005 6:36:03 AM
Bruce,

This works. Once again - thanks for your help.

Isaak

[quoted text, click to view]
Bruce L-C [MVP]
10/28/2005 11:09:48 AM
Appreciate you getting back and letting me know the result. As I said it was
a guess on my part.

--
Bruce Loehle-Conger
MVP SQL Server Reporting Services


[quoted text, click to view]

Henry Chen
6/28/2006 5:15:02 PM
Isaak,
Since yours works, may I ask you a question?

In my main report, the parameter that I want to pass to subreport is
"Fields!CallID.value", so I right-click the subreport in main report,
properties, parameter, parameter name is "CallID", parameter value is
"Fields!CallID.value". In my subreport, my sql query is (In subreport)

select Tracker, EntryDate, EntryText from dbo.Journal
where CallID = @CallID

I go to paramters tab, I see the name is "@CallID" and value =
"Parameters!CallID.value".

when I run from main report, there is no error but subreport is not showing
in the main report. Do I miss something here? Thanks!
Henry

[quoted text, click to view]
Henry Chen
6/28/2006 6:21:01 PM
Issak,
I got it to work. Thanks!
Henry

[quoted text, click to view]
Mon
6/1/2007 10:05:05 AM
Sorry Isac,

I was trying to do the same thing but it did not work for me. Am I missing
something?

[quoted text, click to view]
Mon
6/1/2007 10:07:02 AM
Sorry I forgot to mention, did you manage to get working with multivalue
parameter?

[quoted text, click to view]
AddThis Social Bookmark Button