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

Sub Report Parameters

1 Answer 282 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
AFTR
Top achievements
Rank 1
AFTR asked on 24 Jan 2011, 05:59 PM
I'm having some trouble with my sub report. I have a master report that I use to pass some parameters to a sub report.

I created a report parameter on the sub report called "ReportTitle" and I can pass it a hard coded value from the master report.

What I need to do is be able to pass some values to the sub report so I can use those values to dynamically, from code, pull a dataset for the subreport.

I'm not sure how to pass a value to the subreport and then access it in code.

Any help is appreciated.

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 26 Jan 2011, 05:29 PM
Hello Network,

The sender of the event is always the processing counterpart of the data item and it is the receiver of the data source and holds the processed parameters' collection.
Check out the following code snippet and help articles:

private void SuReport1_ItemDataBinding(object sender, EventArgs e)
{
    var report1 = (sender as Telerik.Reporting.Processing.Report);
    var parameter1Value = report1.Parameters["Parameter1"].Value;
    var dataTable1 = GetData(parameter1Value);
    report1.DataSource = dataTable1;
}

Greetings,
Peter
the Telerik team
Get started with Telerik Reporting with numerous videos and detailed documentation.
Tags
General Discussions
Asked by
AFTR
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or