Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

SSRS 2008 - Pass Parameter to Subreport

Posted on 2009-05-06
3
Medium Priority
?
1,594 Views
Last Modified: 2012-05-06
I have a main report with an included subreport.The subreport has dataset with a parameter called @CustomerID. When I view as a standalone report the subreport runs, prompts for customer ID and displays the report.

In the main report, this subreport has a parameter called @CustomerID. I want to set that parameter to the value of a text field on the main report (this text field is populated from a dataset in the main report).

When I try to display the sub report it displays the error "subreport cannot be shown". Can anyone outline how the parameter should be configured on both the subreport and the main report to read the value of the text box and pass it to the subreport's dataset?

Thanks!
0
Comment
Question by:BrogansMom
3 Comments
 
LVL 16

Accepted Solution

by:
Auric1983 earned 1500 total points
ID: 24317883
BrogansMom,

I'm not sure if the properties page is the same on SSRS2008, but in 2005 if you right click on the subreport object in the main report and click on properties there is a Parameters tab, you just have to map to your CustomerID from the main report.

0
 

Author Comment

by:BrogansMom
ID: 24507106
I actualy got it working. I needed to have the parameter as a field on the sub report. Added it, set it to hidden and it's now working fine. Not sure if that's the "official" way to do it but it solved my problem.
0
 

Expert Comment

by:MMarlin7
ID: 25791538
BrogansMom, when you say "parameter as a field on the subreport", you mean the subreport's report parameter right? The one that is given a value in the parent report subreport properties?
I've been trying a long time to do this. This is the closest post i've found related to my issue: continually seeing "Error: Subreport could not be shown"
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It is helpful to note: This is a cosmetic update and is not required, but should help your reports look better for your boss.  This issue has manifested itself in SSRS version 3.0 is where I have seen this behavior in.  And this behavior is only see…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question