Steve Cross
Steve Cross

Reputation: 99

Can I use a parameter for a main report in a subreport in SSRS?

In a report I have, the main report selects data based on a date. It is grouped by department so there is one page per department. Each page (department) has several sub reports. No subs of subs, everything is only one level deep. Each of the subs has it's own dataset (requiring both the department and the date) to pull information for the department. I have no problems relating the subs to the department. It's a field. It also needs to use the date that was passed as a parameter to the main report. When I use defaults for the date, everything works great but I need it to be dynamic. I have tried everything I can think of. Naming the parameter the same as the main report, naming it differently, trying to use the @department as the parameter in the sub. I can't seem to get this simple task to work. I'm sure I'm missing something easy but I'm such a rookie at SRSS that I don't know how to do it. Can anyone point me in the right direction?

Upvotes: 1

Views: 2659

Answers (1)

Hannover Fist
Hannover Fist

Reputation: 10860

The setting for the subreport's parameters are in the subreport container's Parameter tab. You should be able to choose the parameter of the subreport for the Name and then use the function button to choose the parameter of the main report for the Value.

enter image description here

If you use the drop down for the Value, you are selecting from a list of dataset fields not parameters.

Also, make sure that your subreport is not using Available values. If your date parameter isn't one of the Available values, it would be null.

Upvotes: 1

Related Questions