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

Object graph with List

1 Answer 55 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Cesar
Top achievements
Rank 1
Cesar asked on 19 Jan 2011, 05:15 PM

Hi.
I'm trying to display a master-detail report with a populated object graph.
This is the definition of the class report DataSource:

public class Actuacion
{
// A lot of simple properties here...

public IList<Details> Details {get;set;}

...

}


I created two reports.
- the master report with the data to display of the Actuacion class.
- the subreport with the data to display of the Details class.

How can I set the Datasource of the report and the subreport with a concrete instance of this class?
I'm trying to make something like this:

 

Report2

 

 

 

myreport = new Report2();  //Master
myreport .DataSource = reportModel;  //Instance of Actuacion class
SubReport subreport = (SubReport)myreport .Items.Find("subReport1", true)[0]; //Detail
subreport.ReportSource.DataSource = reportModel.Details; 
VisorReports visor = new VisorReports(myreport);
visor.ShowDialog();

 

 

 

 

but the ReportViewer shows no data.

Thanks in advance!!!

Cesar

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 24 Jan 2011, 05:25 PM
Hello Cesar,

We have created a sample WPF Project with the provided code and locally we are able to set the datasource properties of a Master and SubReport. Check out the attached sample project and let us know if you need additional assistance.

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