I'm trying to figure out how to bind a List to a List<T> property of my main data source and I'm having trouble.
I have a report that binds like this:
var report = new TQuoteReport
{
DataSource = new ObjectDataSource
{
DataSource = quote // Quote is my object
}
};
var reportProcessor = new ReportProcessor();
var reportSource = new InstanceReportSource()
{
ReportDocument = report
};
var renderingResult = reportProcessor.RenderReport("PDF", reportSource, null);
return renderingResult.DocumentBytes;
And the Quote looks like this:
public class Quote
{
public int Id { get; set; }
public DateTime Created { get; set; }
...
public List<LineItem> LineItems { get; set; }
}
where LineItem is just a basic object like this:
public class LineItem
{
public int Id { get; set; }
...
}
The main report binding fields work great with [= Fields.Id]
However, I can't figure out how to bind the LineItem List to a List report object. In the designer it will only let me bind the datasource with the ObjectDataSource that is set to Quote. It won't let me choose the LineItem list. I feel like I'm missing something here.
What am I not doing right? I would rather keep it all in one report and not do a subreport if I don't have to.
Thanks!