Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot add a Data Source in web project using the Data Source Configuration Wizard

Problem

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

My issue is that when I run the "Report Wizard" or when I add a new Dataset to the report, the Data Source Configuration Wizard only allows me to use the database. However, in a library project the Data Source Configuration Wizard is completely different and gives me several choices.

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

Questions

Why is it that I'm experiencing a different behavior when I'm adding a Report (.rdlc) to a library project and a web projet ? And how can I select and/or add an object Data Source to my web project ?

Steps to reproduce:

  1. Create a new "Asp.NET Web Application". I used the empty template.
  2. Add a new item: "Report Wizard"

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

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

Now I get this screen (That's the screen I want in the web project): Data Source Configuration Wizard of Library project

Another difference I noted is the Project menu:

In the library project I have "Add New Data Source..."

Project Menu Library Project

But in the web project there is no such thing...

Project Menu Web Project

like image 557
Chris Avatar asked Mar 15 '16 21:03

Chris


1 Answers

It is an existing problem in VS2010 also. The problem is not only with ASP.Net web application but also with ASP.Net MVC web application as well.

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

It seems it is only possible to get different types of data sources only through non-web projects.

I suggest you to create a separate DataLayer library project.

Even Microsoft themselves do not mention any such limitation - https://msdn.microsoft.com/en-us/library/w4dd7z6t(v=vs.100).aspx#chooseadatasourcetype

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

like image 56
Koder101 Avatar answered Oct 05 '22 22:10

Koder101