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
close icon
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.

ReportViewer does not work

Hello,
I test ReportViewer in a simple asp mvc application and it works perfectly, but when I use it in my application it does not work, I get a script error in the browser.
I reproduce the problem in thissample.
Regards

19 Replies

AN Anis November 24, 2016 10:35 AM UTC

Hello again,
Information: I use "Microsoft SQL Server 2016 RC3 Report Builder" to generate my ".rdl" files.

Regards


YD Yuvaraj Devarajan Syncfusion Team November 24, 2016 11:48 AM UTC

Hi Anis,   
   
Thanks for contacting Syncfusion support.   
   
We have tested your sample with the login credentials (username:  admin & password: serenity), but it throws username object invalid error as shown in the below screenshot. So can you share the correct Username and password to validate the mentioned issue at our end.   

 

We have also checked your sample in which the Web API Routing is not registered properly in your application. So, please ensure Web API Routing is registered properly in (App_Start/WebAPiConfig or Global.asax) file as shown in the below code example.   

WebAPiConfig: 
    public static class WebApiConfig 
    { 
        public static void Register(HttpConfiguration config) 
        { 
            config.Routes.MapHttpRoute( 
                name: "DefaultApi", 
                routeTemplate: "api/{controller}/{action}/{id}", 
                defaults: new { id = RouteParameter.Optional } 
            ); 
        } 
    } 

Global.asax.cs: 
    public class MvcApplication : System.Web.HttpApplication 
    { 
        protected void Application_Start() 
        { 
            AreaRegistration.RegisterAllAreas(); 
 
            WebApiConfig.Register(GlobalConfiguration.Configuration); 
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); 
            RouteConfig.RegisterRoutes(RouteTable.Routes); 
        } 
    } 

Please refer to the below UG documentation for more details about sample creation, 

Regards, 
Yuvaraj D. 



AN Anis November 24, 2016 01:08 PM UTC

Hi, 
I tested the login (username:  admin & password: serenity) and there is no problem, then why you don't just create another account (signup) with the link "register a new account", or open the sql database and modify user or create new user.

Regards


AN Anis November 24, 2016 02:40 PM UTC

I made the changes that you suggest but no result, I still have the problem.



Regards


AN Anis November 25, 2016 08:11 AM UTC

Hello, 
This is the errors img

http://imgur.com/afFL0Yc
http://imgur.com/QTmRNbU

Regards


YD Yuvaraj Devarajan Syncfusion Team November 25, 2016 09:18 AM UTC

Hi Anis, 
 
We were unable to reproduce the script error from your application. The issue occurs when loading multiple dialog in the application and the exception is not thrown from ReportViewer control.  We have modified and tested the application and the ReportViewer control is rendered as excepted as shown in the following screenshot.       

 

We have modified the sample and it can be downloaded from, 

Regards, 
Yuvaraj D. 



AN Anis November 25, 2016 12:29 PM UTC

Hello,
Can you please check that you send me the correct sample, because this one:
- has sql problems when running, i can not navigate to report section
- the report view code is disabled (/ * code * /)
- where do the report data come from (in the screenshot image), I am shour that they are not from the controller
- there is just modification in "Global.asax" and new class "WebApiConfig", and I'm already did that

cordially


YD Yuvaraj Devarajan Syncfusion Team November 26, 2016 06:20 AM UTC

Hi Anis, 
  
Sorry for the inconvenience caused. 
  
Can you please check that you send me the correct sample, because this one: 
- has sql problems when running, i can not navigate to report section 
  
In previous update, we have shared the wrong sample link. We have cleared the SQL error from your shared application and it can be downloaded from, 
- the report view code is disabled (/ * code * /) 
- where do the report data come from (in the screenshot image), I am shour that they are not from the controller 
  
We have checked the shared application with the ReportViewer control and without ReportViewer control. So we shared the shared the sample link without ReportViewer control in previous update.  In the shared screenshot, the ReportViewer control is rendered from viewer and control render page. We have shared the correct sample link in above table. 
- there is just modification in "Global.asax" and new class "WebApiConfig", and I'm already did that 
  
We have tested the shared application and found Web API Routing is not registered properly in your application. So we modified your application to make the ReportViewer to run properly at our end. 
  
Regards, 
Yuvaraj D. 



AN Anis November 28, 2016 11:27 AM UTC

Hi,
I delete "SqlErrorStore.cs" to make the sample work, but I get an empty report, I think it's data connection problem.
Can you please enumerate the steps to do, because when I copy this into my project, I always get exception error.

Regards,



YD Yuvaraj Devarajan Syncfusion Team November 29, 2016 11:55 AM UTC

Hi Anis, 

I delete "SqlErrorStore.cs" to make the sample work, but I get an empty report, I think it's data connection problem. 
We were unable to reproduce the mentioned issue at our end. We suspect the report requires credentials for datasource at your end. So, request you to specify the datasource credential details for the report in “OnReportLoaded” method to avoid the mentioned issue at your end as shown in below code example:    

WebAPI: 
        public void OnReportLoaded(ReportViewerOptions reportOption) 
        { 
            var datasources = ReportHelper.GetDataSources(); 
            foreach (var item in datasources) 
            { 
                if (item.DataProvider == "SQL") 
                { 
                    reportOption.ReportModel.DataSourceCredentials.Add(new DataSourceCredentials(item.DataSourceName, "ssrs1", "RDLReport1")); 
                } 
            } 
        } 

We have modified the sample based on this and it can be downloaded from, 

Can you please enumerate the steps to do, because when I copy this into my project, I always get exception error. 
Please find the following steps that we have modified in your application,   
  
·         We have copied our sample RDL file and moved to APP_Data folder   
 
·         We have changed the report path name in the control render viewer page as shown in below code example. 
<div id="ControlRegion"> 
    <div> 
        @(Html.EJ().ReportViewer("reportviewer") 
        .ProcessingMode(Syncfusion.JavaScript.ReportViewerEnums.ProcessingMode.Remote) 
                .ReportPath("~/App_Data/GroupingAgg.rdl") 
        .ReportServiceUrl("/api/ReportAPI")) 
    </div> 
    @(Html.EJ().ScriptManager()) 
</div> 


·         We have modified the processing mode from local to remote in the control render viewer as shown in below code example. Since the data is not passed locally. If we pass the datasource value locally then we need to specify the processing mode is local. 
<div id="ControlRegion"> 
    <div> 
        @(Html.EJ().ReportViewer("reportviewer") 
        .ProcessingMode(Syncfusion.JavaScript.ReportViewerEnums.ProcessingMode.Remote) 
                .ReportPath("~/App_Data/GroupingAgg.rdl") 
        .ReportServiceUrl("/api/ReportAPI")) 
    </div> 
    @(Html.EJ().ScriptManager()) 
</div> 


·         We have used the WebAPI service to process the report in server side and to use WebAPI service, we must register the WebAPI routing in the application. So, the Web API Routing is registered properly in (App_Start/WebAPiConfig or Global.asax) in your application as shown in the below code example.      
WebAPiConfig:  
    public static class WebApiConfig  
    {  
        public static void Register(HttpConfiguration config)  
        {  
            config.Routes.MapHttpRoute(  
                name: "DefaultApi",  
                routeTemplate: "api/{controller}/{action}/{id}",  
                defaults: new { id = RouteParameter.Optional }  
            );  
        }  
    }  
 
Global.asax.cs:  
    public class MvcApplication : System.Web.HttpApplication  
    {  
        protected void Application_Start()  
        {  
            AreaRegistration.RegisterAllAreas();  
  
            WebApiConfig.Register(GlobalConfiguration.Configuration);  
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);  
            RouteConfig.RegisterRoutes(RouteTable.Routes);  
        }  
    }  

Please refer to the below UG documentation to create the ReportViewer sample, 

If the issue persists, then share the issue reproducible screenshot or video to validate the issue. 
 

Regards, 
Yuvaraj D. 



AN Anis November 29, 2016 04:00 PM UTC

Hi,
I have already done all these steps, but the problem is still there.
The problem is in "PostReportAction".
This is some screenshot.

Regards,
Anis


Attachment: Screenshoot_460092a0.rar


AN Anis November 30, 2016 08:25 AM UTC

Hi,
I found that the difference between the project that works and the other that is not is the version of "System.Web.Http", in the first (work correctly) is v 4.0.0 and the second  is v 5.2.3, I try to use v 4.0.0 in my project but I get more errors.
I think that this is what cause problem. Can you test that please?

Regards,
Anis



YD Yuvaraj Devarajan Syncfusion Team November 30, 2016 01:08 PM UTC

Hi Anis,  
 
We have created a ReportViewer sample with the WebAPI version (5.2.3) and it is working fine at our end. The issue occurs when the WebAPI dependent assembly version mismatch in your application. Please ensure the below WebAPI dependent assemblies are referred in same version (5.2.3) at your end.   
·         System.Web.Routing   
·         System.Web.Http 
·         System.Web.WebHost 
·         System.Net.Http 
·         System.Net.Http.WebRequest 
·         System.Net.Http.Formatting 
 
We have prepared the ReportViewer sample with WebAPI version (5.2.3) and it can be downloaded from, 
 
Regards, 
Yuvaraj D. 



AN Anis November 30, 2016 03:54 PM UTC

Hi, 
This is does not resolve the problem too,  I make sure that WebAPI dependent assemblies are referred in same version.

Regards 
Anis


YD Yuvaraj Devarajan Syncfusion Team December 1, 2016 10:34 AM UTC

Hi Anis, 
 
We were unable to reproduce the mentioned issue in your application. We have modified your application by referring the WebAPI version (5.2.3) and it is working fine at our end as shown in below screenshot.   
 
ReportViewer output: 
 
 
We have modified your application and it can be downloaded from, 
 
If the issue persists, then share the reproducible screenshot or share that sample to validate this issue.   
 
Regards, 
Yuvaraj D. 



AN Anis December 1, 2016 12:24 PM UTC

Hi,
I figure out waht cause the issue, I get this problem because my project is running on Local IIS server (and it is published in local server), when I change to IIS Express server all works fine.
I already tested in two different projects and I get the same result.
Any solution for this (my project must run on Local IIS server) ?

I already share a screenshots of my code, you found it in "anis Replied on November 29, 2016 11:00", and you can find here more screenshots about the problem.

Regards,
Anis

Attachment: screenshots_2e632125.rar


YD Yuvaraj Devarajan Syncfusion Team December 2, 2016 12:30 PM UTC

Hi Anis, 
 
On further analysis of the mentioned issue, you have specified the Relative path for WebAPI in ReportServiceUrl. So, the relative path for the WebAPI controller is not loaded when you deploy the application in local IIS. After specifing the absolute path for the WebAPI in ReportServiceUrl the Report is rendered properly. Please specify the absolute path for WebAPI URL to avoid the issue at your end as shown in the below code example,   

<div id="ControlRegion"> 
    <div> 
        @(Html.EJ().ReportViewer("reportviewer") 
        .ProcessingMode(Syncfusion.JavaScript.ReportViewerEnums.ProcessingMode.Remote) 
                .ReportPath("~/App_Data/GroupingAgg.rdl") 
                        .ReportServiceUrl(VirtualPathUtility.ToAbsolute("~/api/ReportAPI"))) 
    </div> 
    @(Html.EJ().ScriptManager()) 
</div> 

We have modified your shared application and it can be downloaded from, 

Regards, 
Yuvaraj D. 



AN Anis December 2, 2016 02:21 PM UTC

Hi Yuvaraj D,
Thank you for your help, it works now.



AP Ashwini Paranthaman Syncfusion Team December 5, 2016 09:32 AM UTC

Hi Anis, 
Thank you for the update. 
We are glad that your requirement has been met. 
Regards, 
Ashwini P. 


Loader.
Live Chat Icon For mobile
Up arrow icon