all groups > sql server reporting services > september 2006 >
You're in the

sql server reporting services

group:

Subreport with parameters



Re: Subreport with parameters Steve MunLeeuw
9/12/2006 10:08:31 AM
sql server reporting services: You create the parameters in the subreport like normal parameters, then when
you use the subreport control in the master report, the properties dialog
has a parameters tab where you can map the master parameters to the
subreport parameters. Only the master parameters are displayed to the end
user.

Steve MunLeeuw

[quoted text, click to view]

Subreport with parameters Mark Goldin
9/12/2006 10:37:29 AM
How do I create parameters in a subreport that will be coming from the
master report?

Thanks

Re: Subreport with parameters Bruce L-C [MVP]
9/12/2006 11:08:56 AM
A subreport is a normal report. Create the report with parameters and test
it. Then drag and drop onto your main report. Do a right mouse click on the
subreport, properties (or is it parameters). Anyway, once you do a right
mouse click you will see where you map the sub report parameters. If doing a
master detail type report then you map the detail subreport to the fields of
the master.


--
Bruce Loehle-Conger
MVP SQL Server Reporting Services

[quoted text, click to view]

Re: Subreport with parameters Mark Goldin
9/12/2006 11:20:59 AM
But how can I create parameters in a subreport in a normal way if I dont
have any available values to specify?
I have no queries in the subreport.

[quoted text, click to view]

Re: Subreport with parameters Bruce L-C [MVP]
9/12/2006 12:20:41 PM
You are quite confused about subreports. If you have no queries in the
subreport then what is it doing. If there are no queries in the subreport
then you do not even need a subreport.


--
Bruce Loehle-Conger
MVP SQL Server Reporting Services

[quoted text, click to view]

Re: Subreport with parameters Mark Goldin
9/12/2006 12:26:32 PM
I do have one query to get a dataset. But I dont have any other sources to
create parameters.
I have no queries to specify available values, nor I have parameters. (and
that I would expect to be available since I have specified parameters for
the subreport in the master report).

[quoted text, click to view]

Re: Subreport with parameters Bruce L-C [MVP]
9/12/2006 12:33:40 PM
Your parameters do not have to be based on queries. That is just to give the
user a list to choose from. If your query does not use a parameter then it
will not work for what you want. Take a typical master - detail.The master
is returning a list of PO numbers, the detail is listing all the items for
the PO. In this case the subreport should be a report with a query that
accepts a PO number and returns the items. The subreport is dropped onto the
master and the parameter is mapped to the PO field. For each PO on the
master the subreport is called and returns the items.

You need to reconsider what you are doing. A subreport with no parameter
makes no sense. If it is an existing report you are considering then make a
copy of it and turn it into a parameterized report.


--
Bruce Loehle-Conger
MVP SQL Server Reporting Services

[quoted text, click to view]

Re: Subreport with parameters Mark Goldin
9/12/2006 12:42:10 PM
My subreport does use a parameter that should be provided by the master
report. But I can't create parameter in the subreport because I dont know
how to specify a value of it.

[quoted text, click to view]

Re: Subreport with parameters Bruce L-C [MVP]
9/12/2006 12:46:25 PM
OK, we are getting closer. First, can you run the report which will be the
subreport stand alone? That is important. You should alway first test the
subreport as a report on its own. Until then you cannot do anything.


--
Bruce Loehle-Conger
MVP SQL Server Reporting Services



[quoted text, click to view]

Re: Subreport with parameters Mark Goldin
9/12/2006 12:49:47 PM
No, I can't run it because it says that my parameter has no value.

[quoted text, click to view]

Re: Subreport with parameters Bruce L-C [MVP]
9/12/2006 1:22:34 PM
That is what you need to solve before you even try to use the report as a
subreport. Are you being prompted for a parameter?

Go to the dataset and click on the ... parameters tab. The query parameter
needs to be mapped to a report parameter. RS automatically creates a report
parameter for each query parameter.


--
Bruce Loehle-Conger
MVP SQL Server Reporting Services

[quoted text, click to view]

Re: Subreport with parameters Mark Goldin
9/12/2006 1:28:45 PM
Yes, query parameter is mapped to the report parameter. I checked that in
dataset's parameters tab.
No, I am not being prompted for a parameter.

[quoted text, click to view]

Re: Subreport with parameters Bruce L-C [MVP]
9/12/2006 1:39:35 PM
Just to be clear, you are running the report stand alone, not as a
subreport. Subreports will not prompt, you have to map the report parameter
for the subreport to something in the main report (either a field of a
dataset, a report parameter, an expression, something).

Assuming you are running standalone, go to the layout tab. Menu Reports->
Report Parameters. See if you have the parameter there. If not then you have
a problem. You need to add one and then make sure it is mapped to the query
parameter.


--
Bruce Loehle-Conger
MVP SQL Server Reporting Services

[quoted text, click to view]

Re: Subreport with parameters Mark Goldin
9/12/2006 1:47:00 PM
<You need to add one and then make sure it is mapped to the query parameter.
What query? the one I am using to get a dataset? I dont think it's right.

[quoted text, click to view]

Re: Subreport with parameters Bruce L-C [MVP]
9/12/2006 1:56:34 PM
Please post your query.


--
Bruce Loehle-Conger
MVP SQL Server Reporting Services

[quoted text, click to view]

Re: Subreport with parameters Mark Goldin
9/12/2006 1:57:55 PM
I finally got it working.
What strange is that when I click on a job in the master I am getting a
subreport but in the new Browser, when I click on a plus sign I am getting
an error:
Error: Subreport could not be shown.

[quoted text, click to view]

Re: Subreport with parameters Mark Goldin
9/12/2006 2:00:30 PM
select a.id, job, nneedqty, description
from udf_FindJob(@job, 0) a
inner join jobstatus
on active = jobstatus.status
order by jobcategory

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