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

5

11

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?

Andresandresen answered 27/5, 2010 at 17:59 Comment(0)
A
15

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.

Antecedent answered 27/2, 2011 at 12:34 Comment(2)
Still striking this issue in VS2013 with an MVC/Razor project. Adding a dummy WebForm (*.aspx) fixed it. Somewhere, someone knows why this ridiculous dependency was added. Hopefully they have the will and the means to fix it!Stiff
Yes, I see something now but I still do not see the classes of my model! Can you help me please?Bustee
M
2

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.

Mckeehan answered 18/7, 2011 at 2:13 Comment(1)
This seems to have done the job for me. A morning of frustration is over. Thank you!Noles
B
0

Try this...

https://msdn.microsoft.com/en-us/library/yft2c9ad.aspx

On the menu bar, choose View, Other Windows, Data Sources (or choose the Shift+Alt+D

Battat answered 26/8, 2015 at 10:35 Comment(0)
N
0

I had the same problem in Visual Studio 2008. The solution I accidently found was to do the following: 1 - Launch VS 2008 2 - Open Solution 3 - Open report file (rdlc) and make sure "Website Data Sources" pane is showing 4 - Close VS 2008 (with the rdlc "having focus" 5 - Launch VS 2008 6 - Open Solution You should now see the data in the Website Data Sources pane

Necrophobia answered 1/12, 2016 at 14:15 Comment(0)
B
0

One of the problems I had was that my DataSource class didn't have a parameterless constructor...after the parameterless constructor was added "the class" showed up in the DataSource list.

Small detail, but lost some time to figure it out. :)

Bernhardt answered 8/12, 2016 at 20:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.