This is a migrated thread and some comments may be shown as answers.

Simple Subreport Parameter not Working

3 Answers 138 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Robert Bross
Top achievements
Rank 1
Robert Bross asked on 14 Jan 2015, 04:47 PM
I have a simple Master/Detail type report that I'm trying to develop, however I'm running into a binding issues with relating the Detail to the Master. The only "advanced" part of this is that I am setting the datasource dynamically for the subreport and then creating a new InstanceReportSource. Could that possibly have something to do with it? Below is various screenshots of how I have everything setup and the results I'm getting. 

1) A simple texbox on the report to display the value of the field I'm pulling from the datasource (This works)
2) The Sub Report
3) The Parameters of the ReportSource for the subreport. There is a single StudentId parameter. This is set to the same field that is being displayed (Item 1)
4) The Report Parameters of the SubReport
5) The output of the SubReport when it is run. The Date column is setup to use the StudentId parameter (Item 4)
6) The code that is being used to set the DataSource for the SubReport

Any ideas or suggestions would be Greatly appreciated! Thanks in advance!

3 Answers, 1 is accepted

Sort by
0
Robert Bross
Top achievements
Rank 1
answered on 14 Jan 2015, 04:49 PM
Sorry, screenshot didnt post with the thread so attaching the file
0
Accepted
Nasko
Telerik team
answered on 19 Jan 2015, 12:51 PM
Hello Robert,

The parameters configuration at step 3. in the Edit Parameters window is stored inside the ReportSource.Parameters collection.
Then at step 6. you are creating a new report source and using it for the SubReport item:
(telitems[0] as Telerik.Reporting.SubReport).ReportSource = new InstanceReportSource { ReportDocument = report };

At this point you are no longer using the previously configured report source, meaning you are erasing all of the information stored at step 3. You will need to configure it once again adding the needed parameters and values to the InstanceReportSource.Parameters collection programmatically.

Regards,
Nasko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Robert Bross
Top achievements
Rank 1
answered on 19 Jan 2015, 03:25 PM
This worked perfectly!! Thanks Nasko!!!
Tags
General Discussions
Asked by
Robert Bross
Top achievements
Rank 1
Answers by
Robert Bross
Top achievements
Rank 1
Nasko
Telerik team
Share this question
or