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.
Unfortunately, activation email could not send to your email. Please try again.

ReportViewer does not work

Thread ID:

Created:

Updated:

Platform:

Replies:

127564 Nov 23,2016 10:24 AM Dec 5,2016 04:32 AM ASP.NET MVC 19
loading
Tags: ReportViewer
Anis
Asked On November 23, 2016 10:24 AM

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

Anis
Replied On November 24, 2016 05:35 AM

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

Regards

Yuvaraj Devarajan [Syncfusion]
Replied On November 24, 2016 06:48 AM

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. 


Anis
Replied On November 24, 2016 08:08 AM

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

Anis
Replied On November 24, 2016 09:40 AM

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



Regards

Anis
Replied On November 25, 2016 03:11 AM

Hello, 
This is the errors img

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

Regards

Yuvaraj Devarajan [Syncfusion]
Replied On November 25, 2016 04:18 AM

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. 


Anis
Replied On November 25, 2016 07:29 AM

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

Yuvaraj Devarajan [Syncfusion]
Replied On November 26, 2016 01:20 AM

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. 


Anis
Replied On November 28, 2016 06:27 AM

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,


Yuvaraj Devarajan [Syncfusion]
Replied On November 29, 2016 06:55 AM

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. 


Anis
Replied On November 29, 2016 11:00 AM

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

Anis
Replied On November 30, 2016 03:25 AM

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


Yuvaraj Devarajan [Syncfusion]
Replied On November 30, 2016 08:08 AM

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. 


Anis
Replied On November 30, 2016 10:54 AM

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

Regards 
Anis

Yuvaraj Devarajan [Syncfusion]
Replied On December 1, 2016 05:34 AM

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. 


Anis
Replied On December 1, 2016 07:24 AM

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

Yuvaraj Devarajan [Syncfusion]
Replied On December 2, 2016 07:30 AM

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. 


Anis
Replied On December 2, 2016 09:21 AM

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


Ashwini Paranthaman [Syncfusion]
Replied On December 5, 2016 04:32 AM

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


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

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.

;