Hi all. I have a problem and don't know how to fix. I add a reportviewer control to aspx and try to set the ReportSource from code behind. The report is rendering on page, but unfortunately there is no content. When debugging i see that the ReportSource of report viewer is the same, which i bind, but no table shows on screen. I'm creating the Report object programmatically. If load report, created from standalone Report Designer there is no problem.
This is the custom object I've tried to bind:
"[DataObject]
public class ReportSource
{
[DataObjectMethod(DataObjectMethodType.Select)]
public IList<Source> GetData()
{
var result = new List<Source>();
var data = ActiveTradesCache.GetActiveTradeData();
foreach (var item in data)
{
result.Add(new Source() { Rate = item.OrderRate });
}
return result;
//trgOpendDeals.DataSource = new Object[0];
//trgOpendDeals.MasterTableView.VirtualItemCount = 0;
//trgOpendDeals.DataBind();
}
}
public class Source
{
public double Rate { get; set; }
}
"
And the fill source method, which is in Page_Load event:
"
Telerik.Reporting.ObjectDataSource objectDataSource = new Telerik.Reporting.ObjectDataSource();
objectDataSource.DataSource = typeof(ReportSource);
objectDataSource.DataMember = "GetData";
Telerik.Reporting.Report report = new Telerik.Reporting.Report();
report.DataSource = objectDataSource;
Telerik.Reporting.InstanceReportSource reportSource = new Telerik.Reporting.InstanceReportSource();
rvOpenDeals.ReportSource = reportSource;
// Calling the RefreshReport method in case this is a WinForms application.
rvOpenDeals.RefreshReport();
reportSource.ReportDocument = report;
"
Best regards,
Lachezar