Unable to add data source to web project using data source configuration wizard

problem

I want to add a report (.rdlc) to my web project. I need a report to use an object data source, and not directly connect to the database.

My problem is that when I launch the Report Wizard or when adding a new Dataset to the report, the Data Source Setup Wizard only allows me to use the database. However, in the library project, the data source configuration wizard is completely different and gives me several options.

I tested with Visual Studio 2013 and 2015 (Community Editions)

Questions

Why is there a different behavior when adding a report (.rdlc) to the library project and web project? And how can I select and / or add a Data Source object to my web project?

Playback Actions:

  1. Create a new Asp.NET Web Application. I used an empty template.
  2. Add New Item: Report Wizard

Then the following windows will open: Data Source Configuration Wizard Of Web Project

  1. Add a new project like Class Library to the same solution.
  2. Add new item: Report Wizard (to the library project)

Now I get this screen (This is the screen I want in a web project): Data Source Configuration Wizard of Library project

Another difference that I noticed is the Project menu:

In the library project, I have "Add a new data source ..."

Project Menu Library Project

But this is not in the web project ...

Project Menu Web Project

+7
source share
3 answers

There is also an existing issue in VS2010. The problem is not only in the ASP.Net web application, but also in the ASP.Net MVC web application.

Link - Visual Studio 2010 Local SSRS Report (.rdlc) with Object Data Source

It seems that you can get data sources of different types only through non-web projects.

I suggest you create a separate project for the DataLayer library.

Even Microsoft itself does not mention such a restriction - https://msdn.microsoft.com/en-us/library/w4dd7z6t(v=vs.100).aspx#chooseadatasourcetype

Note. I checked with VS2010 and VS2015 (Enterprise Edition).

+4
source

It may not cost much, but the SqlDataSource wizard looks for existing database connections in Server Explorer and the current project in the configuration file. I am wondering if your problem is related to the web.config file that needs to be populated on a web page, but not for a standard report?

It may not be so, but it's just hot here.

+1
source

Try View -> Database Explorer. And in the database explorer, right-click in an empty space and select Add Connection.

View -> Database Explorer

+1
source

Source: https://habr.com/ru/post/1245119/


All Articles