Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't see or add Website Data Sources in RDLC report in ASP.NET MVC

In the RDLC report, in Design view in Visual Studio 2008, we don't see anything in the Website Data Sources tab and the button to Add New Data Source is grayed out. Only the Refresh button is enabled, and clicking it doesn't do anything. Our business logic layer returns Lists of business objects and the business logic and business object projects are both referenced by the MVC project. This is an MVC app, so there is no App_Code folder.

How do we get our business objects to appear in the Website Data Sources list so we can drag and drop fields from the object onto our RDLC report?

like image 416
RobertC Avatar asked May 27 '10 17:05

RobertC


People also ask

How do I enable Report data in Visual Studio?

To display the Report Data pane In Design view, on the View menu, select Report Data, or use CTRL+ALT+D.


2 Answers

I think I suffered the same problem as this.

I solved this by closing all open VS windows, cleaning, rebuilding the solution then adding a new WebForms page (yes I know its MVC) but it then seemed to trigger a refresh in something and the data sources showed up when we reopened and editted the rdlc file.

like image 116
Phil Avatar answered Oct 27 '22 23:10

Phil


I have also been frustrated by this, using VB.NET, but this should fix it:

In addition to the reference to:

  • Microsoft.ReportViewer.Winforms or
  • Microsoft.ReportViewer.WebForms

You need to also add a reference to:

  • Microsoft.ReportViewer.Common

The Data Sources panel is still blank, but when you select Add Dataset, you'll see the correct options.

like image 43
Ian Fry Avatar answered Oct 27 '22 21:10

Ian Fry