calling ssrs report with sub report from .net

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

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

In my 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.

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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.ContentType = "application/pdf";
                Response.AppendHeader("content-disposition", "attachment; filename = "+Request.QueryString[0].ToString()+".pdf");
Alpesh PatelAssistant ConsultantCommented:
Please get the object of main report and do the same as main report to pass parameter to sub-report also.
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 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.

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.
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

From novice to tech pro — start learning today.