all groups > sql server reporting services > october 2005 >
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
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" <isaak.peretsman at usa.dupont.com (no spam)> wrote in message news:4785EFE4-9436-4715-8AA4-A57CC8E9AC78@microsoft.com... > 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, This works. Once again - thanks for your help. Isaak [quoted text, click to view] "Bruce L-C [MVP]" wrote: > 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 > > "isaak" <isaak.peretsman at usa.dupont.com (no spam)> wrote in message > news:4785EFE4-9436-4715-8AA4-A57CC8E9AC78@microsoft.com... > > 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 > > > >
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] "isaak" <isaak.peretsman at usa.dupont.com (no spam)> wrote in message news:D71C1BB0-7AB0-4CFF-BD5F-D6B789D59906@microsoft.com... > Bruce, > > This works. Once again - thanks for your help. > > Isaak > > "Bruce L-C [MVP]" wrote: > >> 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 >> >> "isaak" <isaak.peretsman at usa.dupont.com (no spam)> wrote in message >> news:4785EFE4-9436-4715-8AA4-A57CC8E9AC78@microsoft.com... >> > 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 >> > >> >> >>
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] "isaak" wrote: > Bruce, > > This works. Once again - thanks for your help. > > Isaak > > "Bruce L-C [MVP]" wrote: > > > 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 > > > > "isaak" <isaak.peretsman at usa.dupont.com (no spam)> wrote in message > > news:4785EFE4-9436-4715-8AA4-A57CC8E9AC78@microsoft.com... > > > 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 > > > > > > >
Issak, I got it to work. Thanks! Henry [quoted text, click to view] "Henry Chen" wrote: > 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 > > "isaak" wrote: > > > Bruce, > > > > This works. Once again - thanks for your help. > > > > Isaak > > > > "Bruce L-C [MVP]" wrote: > > > > > 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 > > > > > > "isaak" <isaak.peretsman at usa.dupont.com (no spam)> wrote in message > > > news:4785EFE4-9436-4715-8AA4-A57CC8E9AC78@microsoft.com... > > > > 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 > > > > > > > > > >
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] "Bruce L-C [MVP]" wrote: > 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 > > "isaak" <isaak.peretsman at usa.dupont.com (no spam)> wrote in message > news:4785EFE4-9436-4715-8AA4-A57CC8E9AC78@microsoft.com... > > 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 > > > >
Sorry I forgot to mention, did you manage to get working with multivalue parameter? [quoted text, click to view] "Henry Chen" wrote: > Issak, > I got it to work. Thanks! > Henry > > "Henry Chen" wrote: > > > 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 > > > > "isaak" wrote: > > > > > Bruce, > > > > > > This works. Once again - thanks for your help. > > > > > > Isaak > > > > > > "Bruce L-C [MVP]" wrote: > > > > > > > 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 > > > > > > > > "isaak" <isaak.peretsman at usa.dupont.com (no spam)> wrote in message > > > > news:4785EFE4-9436-4715-8AA4-A57CC8E9AC78@microsoft.com... > > > > > 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 > > > > > > > > > > > > >
Don't see what you're looking for? Try a search.
|
|
|