We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to create your first ASP.NET MVC Classic version of ReportViewer in MVC Application ?

This section explains you how to create an ASP.NET MVC Classic version of ReportViewer component in MVC application. In the following example, you can learn how to load rdl/rdlc specification reports in ReportViewer component.

  1. Open Visual Studio and create a new project by clicking New Project.
  2. Select the Web category, select the ASP.NET MVC4 Web Application, and then click OK. The following screenshot displays the Project Creation Wizard.

Figure 1: Project Creation Wizard

  1. Select the Empty project template by Select a Template list and select the Razor option in View Engine category and then click OK. The following screenshot displays the Project Template Wizard.

Figure 2: Project Template Wizard

Add References

You can add the following Syncfusion assembly references for ReportViewer.

  1. In the Solution Explorer, right-click the References folder and then click Add Reference.


Figure 3: Adding Reference

  1. Add the following assemblies.
  • Syncfusion.Core
  • Syncfusion.Linq.Base
  • Syncfusion.ReportViewer.MVC
  • Syncfusion.Shared.Mvc
  • Syncfusion.ReportControls.Wpf
  • Syncfusion.ReportWriter.Base
  • Syncfusion.Pdf.Base
  • Syncfusion.XlsIO.Base
  • Syncfusion.DocIO.Base
  • Syncfusion.Shared.Wpf
  • Syncfusion.Chart.Wpf
  • Syncfusion.Gauge.Wpf
  • Syncfusion.SfMaps.Wpf

http://help.syncfusion.com/ug/js/ImagesExt/image77_7.jpgNote: As MVC4 version sample for this tutorial is created, you have to add Syncfusion MVC4 version dlls. Syncfusion has a standard for assembly version number of MVC. For example Syncfusion assembly version is 12.3400.36, the number “4” in the second part. “3400” represents MVC version number. You can obtain Syncfusion MVC assemblies from its installed location C:\Program Files (x86)\Syncfusion\Essential Studio\\Assemblies.

  1. Click OK.

Add Report

You can add report files to your application’s App_Data folder.

Figure 4: Add Report

http://help.syncfusion.com/ug/js/ImagesExt/image77_7.jpgNote: You can obtain sample rdl/rdlc files from Syncfusion installed location (%userprofile%\AppData\Local\Syncfusion\EssentialStudio\X.X.X.X\Common\Data\ReportTemplate). “X.X.X.X” is the Essential Studio Release Version.

Add Controller

  1. Right-click on the project and select Add. The following screen shot shows the Add New Item Wizard.



Figure 5: Add New Item Wizard

  1. Click New Item and select MVC4 Controller Class from the listed templates.

Figure 6: Adding Controller

  1. Name the controller as ReportViewerController.cs and click ok.
  2. Add the following code to ReportViewerController.

Add View

  1. In the Controller, right-click on Index action method name and then click Add View.

Figure 7: Add View Menu

  1. Specify the View Name and click Add.

Figure 8: Add View Wizard

  1. Add the following code to Index.cshtml Razor Page.

Configure Web.config

  1. Register the assemblies by adding the following code example inside the <system.web> tag in web.config file at the root folder.

http://help.syncfusion.com/ug/js/ImagesExt/image77_7.jpgNote: x.x.x.x in the above code example refers to the current version of the Essential Studio running in your system.

  1. Add the following namespaces to the web.config files in root folder and View folder.
  1. Add the following httpHandler’s code for resource handling inside to the <system.web> tag in web.config file.
  1. Add the following handler’s code inside the <system.webServer> tag of web.config for resource handling in IIS Web Server.

Run the Application

Run the sample application and you can see the ReportViewer on the page as displayed in the following screenshot.


Figure 9: ReportViewer with Parameter Report

Demo Sample

You can download the demo sample from the following link.


Further References

You can find documentation and online demo samples for ASP.NET MVC Classic ReportViewer control from the following links.



Newer ASP.NET MVC version of ReportViewer

You can try newer version of MVC ReportViewer that is powered by JavaScript/HTML5. You can find the documentation and online demo samples for newer ASP.NET MVC ReportViewer control from the following links.



Article ID: Published Date: Last Revised Date: Platform: Control: .NET Framework:
2670 11/14/2014 11/14/2014 ASP.NET MVC (Classic) ReportViewer 4
Did you find this information helpful?
Add Comment
You must log in to leave a comment

Please sign in to access our KB

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon