Trying to follow this original thread:http://www.telerik.com/forums/asp-net-mvc4-using-pass-model-to-objectdatasource#n3Sejx7cSEKjJ3clQNeH7w which is closed.
I modified the mvc project to display the ListBoundReport directly, using a custom resolver.
public class CustomReportResolver : IReportResolver
{
ReportSource IReportResolver.Resolve(string report)
{
var nreport = new ListBoundReport();
var ds = new Cars().GetRange(1, 2);
nreport.DataSource = ds;
var irs = new InstanceReportSource { ReportDocument = nreport };
return irs;
}
}
This displays the same 7 original cars
nreport.DataSource = null; did not clear the items
If I remove the datasource from the report (objectDataSource1.DataSource) It will display two records, but both will be blank (not tied to the values).
Please explain both behaviors:
1. Why setting the Datasource has no effect
2. Why after removing Datasource from report only works half way (not bound to fields)
And what we need to do to get this to work correctly
Thanks,
Steve