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. Image for the cookie policy date
Starting in 2019, the Reporting control is no longer included in Essential Studio. If you're experiencing issues with the Syncfusion Reporting Platform, Report Viewer, Report Designer, or Report Writer, we recommend migrating to Bold Reports, our dedicated reporting platform.

Bold Reports offers a comprehensive suite of tools and features for all your reporting needs, and we will help you make a smooth transition from the discontinued control. Our support team at https://support.boldreports.com/ is here to assist you with any questions or difficulties you may encounter during the migration process.

We thank you for choosing Syncfusion and appreciate your understanding.

Data not binding to Report viewer using ASP.NET MVC

I have used syncfusion report viewer but while loading report in view there is Excepition thrown

the screen snapshot or exception i attached with thread

the view code is:

<link rel='nofollow' href="http://cdn.syncfusion.com/js/web/flat-azure/ej.web.all-latest.min.css" rel="stylesheet" />
<script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js" type="text/javascript"></script>
<script src="http://cdn.syncfusion.com/js/web/ej.web.all-latest.min.js" type="text/javascript"></script>
<script src=" http://cdn.syncfusion.com/js/web/ej.unobtrusive-latest.min.js" type="text/javascript"></script>

@using Syncfusion.MVC.EJ
@using Syncfusion.JavaScript.Models
@using Syncfusion.JavaScript
@*@using Syncfusion.JavaScript.ReportViewer*@

  <div style="width: 100%">
.DataSources(ds => ds.Name("Customer").Value(ViewData["cust"]).Add()))


and the code of controlle as :
   public class ReportApiController : Controller, IReportController
        public ActionResult Report()
            ViewData["cust"] = GetList();
            return View();
        public object PostReportAction(Dictionary<string, object> jsonResult)
            return ReportHelper.ProcessReport(jsonResult, this);
        //Get action for getting resources from the report
        public object GetResource(string key, string resourcetype, bool isPrint)
            return ReportHelper.GetResource(key, resourcetype, isPrint);
        //Method will be called when initialize the report options before start processing the report
        public void OnInitReportOptions(ReportViewerOptions reportOption)
            //You can update report options here
        //Method will be called when reported is loaded
        public void OnReportLoaded(ReportViewerOptions reportOption)
            //You can update report options here

        public List<CustomerVM> GetDataForReport()
            return GetList();

        private List<CustomerVM> GetList()
            var list = new List<CustomerVM>();

            var cust1 = new CustomerVM { Id = 1, FirstName = "ssss", LastName = "ff", MobileNo = "9098908990", Email = "a@gmail.com" };
            var cust2 = new CustomerVM { Id = 2, FirstName = "ddd", LastName = "bbb", MobileNo = "9098908990", Email = "a@gmail.com" };
            var cust3 = new CustomerVM { Id = 3, FirstName = "ccc", LastName = "mmm", MobileNo = "9098908990", Email = "a@gmail.com" };
            var cust4 = new CustomerVM { Id = 4, FirstName = "ssss", LastName = "ff", MobileNo = "9098908990", Email = "a@gmail.com" };
            var cust5 = new CustomerVM { Id = 5, FirstName = "ddd", LastName = "bbb", MobileNo = "9098908990", Email = "a@gmail.com" };
            var cust6 = new CustomerVM { Id = 6, FirstName = "ccc", LastName = "mmm", MobileNo = "9098908990", Email = "a@gmail.com" };
            var cust7 = new CustomerVM { Id = 7, FirstName = "ssss", LastName = "ff", MobileNo = "9098908990", Email = "a@gmail.com" };
            var cust8 = new CustomerVM { Id = 8, FirstName = "ddd", LastName = "bbb", MobileNo = "9098908990", Email = "a@gmail.com" };
            var cust9 = new CustomerVM { Id = 9, FirstName = "ccc", LastName = "mmm", MobileNo = "9098908990", Email = "a@gmail.com" };




            return list;


and i have set application startup page in Global.aspx.cs:

  public static void RegisterRoutes(RouteCollection routes)

                "Default", // Route name
                "{controller}/{action}/{id}", // URL with parameters
                new { controller = "Login", action = "Login", id = UrlParameter.Optional } // Parameter defaults

Attachment: Image1_2744d245.rar

3 Replies

SR Soundara Rajan S Syncfusion Team December 29, 2015 06:26 AM UTC

Hi Dhanashri,

Thanks for contacting Syncfusion support.

In the shared code example, you have inherited the IReportController in MVC controller instead of WebAPI controller. We are internally processing the report based on WebAPI JSON results (RESTFUL Service) and it’s not working with MVC action result. Due to this, you have faced the mentioned issue at your end. So, please inherit the IReportController in your WebAPI instead of MVC controller.

We have prepared standalone based on your requirement and it can be downloaded from below location,

You can obtain the MVC ReportViewer samples from the below build installed location,

Please refer to the below UG documentation for more details,

Soundara Rajan S

DK dhanashri kadam December 29, 2015 06:37 AM UTC

Thanks for your reply.

SR Soundara Rajan S Syncfusion Team December 30, 2015 05:06 AM UTC

Hi Dhanashri,

Thanks for your response. Please let us know, if you need any further assistance on this.

Soundara Rajan S.

Live Chat Icon For mobile
Up arrow icon