I'd like to load the object data source based on a parameter rather than a hardcoded datasource as in your example or be able to run the report off a dynamically created set of objects that is pased into the report.
Your example code for a master detail report using objects looks like this:
public
RptOrders()
{
/// <summary>
/// Required for telerik Reporting designer support
/// </summary>
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
this.DataSource = Middle.Order.CreateOrderList();
}
private void subReport1_NeedDataSource(object sender, System.EventArgs e)
{
Telerik.Reporting.Processing.
SubReport subReport = (Telerik.Reporting.Processing.SubReport)sender;
subReport.InnerReport.DataSource = ((System.Data.
DataRowView)subReport.DataItem)["OrderLines"];
}
How can I asign a dynamically created set of objects to the datasource? Could I pass a list of objects into another constructor for the report? as in:
public RptOrders(List<RptOrder> rptOrders)
{
/// <summary>
/// Required for telerik Reporting designer support
/// </summary>
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
this.DataSource = rptOrders;
}
I'm using q1 2008 reporting in a web project.