calling ssrs report with sub report from .net

I have several ssrs 2008 reports that I am calling from asp.net.
The reports all work fine when I run them in Visual Studio.

Also, the basic reports run fine when I call them from asp.net and pass parameters.
But if I call a report with a subreport from asp.net I get the error that the sub report can't be displayed.

In my asp.net code do I have to explicitly load the sub report and set its parameters?
Currently i am only loading the main report and setting the parameters -

rsExecService.ExecutionInfo ei = rsExec.LoadReport(_reportName, historyID);
rsExecService.ParameterValue[] parameters = new rsExecService.ParameterValue[urlParams.Length];
(more code not shown)

The sub report uses the same parameters so I assumed it would just inherit from the parent.

Thanks, Kevin.

kevinvw1Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

kevinvw1Author Commented:
more info -

I am not using the ReportViewer, I am rendering the report straight out to PDF -

results = rsExec.Render(format, deviceInfo, out extension, out encoding, out mimeType, out warnings, out streamIDs);
                Response.ClearContent();

                Response.ContentType = "application/pdf";
                Response.AppendHeader("content-disposition", "attachment; filename = "+Request.QueryString[0].ToString()+".pdf");
                Response.BinaryWrite(results);
0
Alpesh PatelAssistant ConsultantCommented:
Please get the object of main report and do the same as main report to pass parameter to sub-report also.
0
TempDBACommented:
while calling the sub-report from the main report, pass the paramter value from the dataset of the first report. i.e. when you embed a subreport into a report, you can pass the parameter to the subreport by default. The default parameters will be fetched on run-time by the output result of the main report. I haven't done this from asp.net but from visual studio in SSRS while building the report , right click on the sub-report you have placed and for the parameters value, pass your desired outputs from the main report.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
kevinvw1Author Commented:
Thanks for you help.  The issue was actually with the reports themselves.  I realized that I couldn't even get the reports to run using the standard SSRS web interface.
They would run from inside visual studio but not when deployed.  I went in to Visual Studio and re-selected the sub report name in the parent report and then re-deployed and everything started working.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
SSRS

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.