Friday, February 15, 2013 12:21 AM
I have a main report and I am trying to add a sub report. This main report if filtered by a parameter. The subreport should also be filtered by the same parameter. Here are my steps.
1. I add a new subreport by dragging the subreport source from the Solution Explorer into the main report design space.
If I try to preview the report at this stage I get the following error on the previewed report:"One or more parameters were not specified for the subreport 'Subreport', located at: /SubreportSourceLocation
2. I then try to add a parameter to the subreport and I get no options for parameters names despite there being identical parameters available in both the subreport source and the main report.
3. I try to manually enter the appropriate parameter information and I get: "Error: Subreport cound not be shown."
Also the following warning is issued "Warning 1 [rsWarningExecutingSubreport] Warnings occurred while executing the subreport ‘Subreport’. [rsNone] An attempt was made to set a report parameter 'SubreportSource' that is not defined in this report. "
I'm new at and still trying to make sense of this framework. Thanks in advance.
Friday, February 15, 2013 5:59 PM
Hello! Turns out, that dragging the subreport source from the solutions explorer does not let you select the subreport parameter. The field is returned blank, as I pointed out on step 2. You need to create a subreport from the toolbox, then set the subreport source from the subreport properties (right click the subreport in design view, select properties).
The warnings seem to still persist, but the reports are showing!
- Edited by JMT_2080AD Friday, February 15, 2013 6:00 PM
Monday, February 18, 2013 11:03 AMModerator
As you have found, we need to drag the Subreport control from the Toolbox to the design surface when adding a subreport to the main report. Regarding the warning messages issue, this behavior is by design. To eliminate the warnings, we can just close the project and reopen it.
How to: Add a Subreport and Parameters
TechNet Community Support
- Marked As Answer by Mike YinMicrosoft Contingent Staff, Moderator Friday, February 22, 2013 6:18 AM