0

I am facing a problem with adding two projects in the same solution and both run as a single instance.

Let me explain that in more details. I have MVC project which is the main web application I used in my project now I want to add a new asp.net application to use for rendering reports and get the benefit of using asp.net page with Report Viewer.So, I was thinking in adding a new asp.net application that will contains my reports then map this new pages to my mvc application

The problem is how to deploy these two instances as one application in server. I know that i can run both applications in debug mode by using debug > start new instance but how i can manage that in server.

Also is there is a way to deal with those two applications as one application

Update:

Using Ihor idea and with the help of this tutorials

How can I use a reportviewer control in an asp.net mvc 3 razor view?

http://msdn.microsoft.com/en-us/library/ms251692%28v=vs.100%29.aspx

I am facing a problem in binding to my object datasource attached to project. For example I have repository for SalesInvoices and I want to use GetData function exists in that repository to bind report with

Community
  • 1
  • 1
Mohamed Salah
  • 959
  • 10
  • 40

2 Answers2

1

ASP.NET MVC is built on regular ASP.NET Web Forms. In your scenario you don't need to have a specific different project for Reports, you can have Reports inside your MVC project. For example you can add a new GenericReport.aspx under some folder (for example "Reports") of your MVC project.

Then when user requests some action on your site you can use PartialView with iframe to your GenericReport.aspx. On this page you can add any webforms-specific logic that you need.

To be honest I am not aware of such particular behaviour of reports, but according to the reply: How can I use a reportviewer control in an asp.net mvc 3 razor view? you will probably need to move your data to a separate project. It shouldn't be web application project but a class library (generating .dll) and you can use it in your MVC project.

Community
  • 1
  • 1
Ihor Deyneka
  • 1,326
  • 1
  • 19
  • 37
  • its a good idea but i am facing a problem that i can't see my models in report1.rldc i think because project is mvc project i want to bind `ObjectDataSource` instead of `DatabaseSource` any idea how to solve this issue Update: I go through that tutorial to add report to aspx page [http://msdn.microsoft.com/en-us/library/ms251692%28v=vs.100%29.aspx] – Mohamed Salah Jul 30 '13 at 11:56
  • Your link is not working. You should be able to use everything you want for reports both in MVC and WebForms – Ihor Deyneka Jul 30 '13 at 12:01
  • I am not sure I understand what DatabaseSource is. Can you please update your original post with more information and problems you face when trying to use my approach. – Ihor Deyneka Jul 30 '13 at 12:14
1

Using Ihor idea and with the help of this tutorials

How can I use a reportviewer control in an asp.net mvc 3 razor view?

http://msdn.microsoft.com/en-us/library/ms251692%28v=vs.100%29.aspx

I was facing a problem as I noted in updates in original post I solved by adding a class in reports folder contains method with my model Like that

public class ReportModels
{
    public List<SalesInvoice> GetData()
    {
        return null;
    }
}

with this way i can map this model to report successfully

Community
  • 1
  • 1
Mohamed Salah
  • 959
  • 10
  • 40