Solved

SSRS 2008 - Pass Parameter to Subreport

Posted on 2009-05-06
3
1,572 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 500 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Introduction In the following article I’ll be discussing and demonstrating several different ways of how images can be put on a report. I’m using SQL Server Reporting Services 2008 R2 CTP, more precisely version 10.50.1352.12, but the methods ex…
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…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

820 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