Design Time Problems. ReportSource property from the ReportViewer property grid does not show available reports
Environment
Product | Progress® Telerik® Reporting |
Description
I want to show my report in a ReportViewer control, but when I click on the arrow in the ReportSource property from the property grid, it does not show available reports - what is wrong?
Solution
Follow our best practices and have the report in a separate class library that is referenced in the application or website. Check if the class library containing the report is referenced in your application/website and that you have rebuilt the application/website.
The most reliable way to specify a report for the ReportViewer is to do this programmatically. For example, if you're using the ASP.NET Web Forms Report Viewer, on the Page_Load event of the page:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
var typeReportSource = new Telerik.Reporting.TypeReportSource();
typeReportSource.TypeName = "Telerik.Reporting.Examples.CSharp.ListBoundReport, CSharp.ReportLibrary";
this.ReportViewer1.ReportSource = typeReportSource;
}
}
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
Dim typeReportSource As New Telerik.Reporting.TypeReportSource()
typeReportSource.TypeName = "ListBoundReport, VB.ReportLibrary"
ReportViewer1.ReportSource = typeReportSource
ReportViewer1.RefreshReport()
End If
End Sub