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 } ); } } |
public class MvcApplication : System.Web.HttpApplication { protected void Application_Start() { AreaRegistration.RegisterAllAreas(); WebApiConfig.Register(GlobalConfiguration.Configuration); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); } } |
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. |
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:
We have modified the sample based on this and it can be downloaded from, Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/File_Explorer-1219313276.zip | ||||
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.
· 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.
· 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:
Global.asax.cs:
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. |
<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> |