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
If you became a customer of the Syncfusion Reporting Platform or the Report Viewer, Report Designer, or Report Writer components before October 2019 and have questions related to those products, you can request support through our forum system. However, please note that this support system is only for existing customers who are still using the Syncfusion Reporting Platform or its components and not for new customers looking for reporting products from Syncfusion.

For new customers or those with general reporting questions, we recommend contacting our support team at https://support.boldreports.com/, which is a separate brand created by Syncfusion for its reporting solutions. Our team will be happy to assist you with any questions you may have.

Thank you for choosing Syncfusion for your reporting needs.

Error when loading the report using the local Web API service.

Dear Syncfusion.
I have downloaded the application on Report Platform at the address: https://github.com/syncfusion-reports/angular-docs-samples.
After extracting, installing and rebuilding the application is run well. However, after changing the Online Web API service to Local Web API service, the application issues an error message: 
"main.9bc4c6856d0c0804cdb5.js:1 ERROR TypeError: Cannot read property 'errorInfo' of null
    at Object.success (main.9bc4c6856d0c0804cdb5.js:1)
    at u (polyfills.ccfd83b9a156e9377a70.js:1)
    at Object.fireWith [as resolveWith] (polyfills.ccfd83b9a156e9377a70.js:1)
    at E (polyfills.ccfd83b9a156e9377a70.js:1)
    at XMLHttpRequest.<anonymous> (polyfills.ccfd83b9a156e9377a70.js:1)
    at XMLHttpRequest.D (polyfills.ccfd83b9a156e9377a70.js:1)
    at e.invokeTask (polyfills.ccfd83b9a156e9377a70.js:1)
    at Object.onInvokeTask (main.9bc4c6856d0c0804cdb5.js:1)
    at e.invokeTask (polyfills.ccfd83b9a156e9377a70.js:1)
    at t.runTask (polyfills.ccfd83b9a156e9377a70.js:1)"
Changes in code:
https://reports.syncfusion.com/demos/services/api/ReportViewer --> http://localhost:40986/ReportService/api/Viewer
~/Resources/docs/sales-order-detail.rdl  -->  ~/SampleReports/sales-order-detail.rdl
I have done the host Syncfusion Report Server as website in IIS at port 40986.
Looking forward to receiving Syncfusion support.
Thank you very much.

Illustrating images:
1. Code


2. Public folder structure

3. IIS:


4. Run application 


16 Replies

VS Vinoth Srinivasan Syncfusion Team August 8, 2019 09:09 AM UTC

Hi Duong, 

Thanks for your interest in Syncfusion components. 

We suspect that the mentioned issue occurs when your Web API service don’t have access for external application. So, could you please confirm whether you have specified the Enable origin for Web API service application or not. Please find the below help documentation for how to enable the origins for ASP.NET and ASP.NET Core Web API services. 

Regards, 
Vinoth S. 



DV Duong Vinh Binh August 9, 2019 06:43 AM UTC

Thanks Syncfusion.
Thank you Vinoth Srinivasan,
I will try to find out more about what you have supported.
thank you very much.


VS Vinoth Srinivasan Syncfusion Team August 9, 2019 09:49 AM UTC

Hi Duong, 
 
Thanks for you update. If you still face any issue, then could you please confirm whether you are using any customized serialization for your Web API. 
 
Also, Report Viewer component will work properly with default case serializer only. If you are using the camel serializer for your application, then we will have a problem in processing API result. We must use the default resolver for ReportViewer report service API. You can make use of the below to resolve this issue in case if you are having the camel case property serializer.  
 
config.Formatters.JsonFormatter.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); 
 
 
 In the below code snippet, we have enabled the default serialization resolve using attribute for ReportViewer API alone, 
 
public class DefaultCaseControllerConfigAttribute : Attribute, System.Web.Http.Controllers.IControllerConfiguration 
    { 
        public void Initialize(System.Web.Http.Controllers.HttpControllerSettings controllerSettings, System.Web.Http.Controllers.HttpControllerDescriptor controllerDescriptor) 
        { 
            var formatter = controllerSettings.Formatters.OfType<System.Net.Http.Formatting.JsonMediaTypeFormatter>().Single(); 
            controllerSettings.Formatters.Remove(formatter); 
 
            formatter = new System.Net.Http.Formatting.JsonMediaTypeFormatter 
            { 
                SerializerSettings = { ContractResolver = new Newtonsoft.Json.Serialization.DefaultContractResolver() } 
            }; 
 
            controllerSettings.Formatters.Add(formatter); 
        } 
    } 
 
[DefaultCaseControllerConfigAttribute] 
public class RreportApiController : ApiController, IReportController 
{ 
 
 
 
Regards, 
Vinoth S. 



DV Duong Vinh Binh August 11, 2019 06:11 AM UTC

Dear  Vinoth Srinivasan (Syncfusion).
Thank you for your support.
I tried to follow what you instructed, including: reconfiguring the WebApiConfig and adding code in the Controller files. However, when running the application, there is no error message but it does not load the report. Then, I debuged with Fiddler Web, I saw the following information:



Again looking forward to your support.
Best regards
p/s: Send you 2 files that i have updated


Attachment: update_279d47d7.zip


VS Vinoth Srinivasan Syncfusion Team August 12, 2019 10:27 AM UTC

Hi Duong, 

In our previous update we have requested details whether you are using customized serialization in your WebAPI, so please confirm on this. We suspect that the default serialization resolve work around has been not reflected properly at your end, so we request you to reconfigure the WebAPI with changes. Also, in your code you are throwing exception from “OnInitReportOptions” and “OnReportLoaded” method, please remove that line to render the report in ReportViewer. 

Regards, 
Vinoth S. 



DV Duong Vinh Binh August 13, 2019 11:37 AM UTC

Dear  Vinoth Srinivasan (Syncfusion).
Thank you very much for your supports.
I followed the instructions and the application ran successfully.
Wish you and your family a lot of happiness!
Best regards.


VS Vinoth Srinivasan Syncfusion Team August 13, 2019 11:52 AM UTC

Hi Duong, 

Thanks for your update. Please let us know if you require further assistance on this. 

Regards, 
Vinoth S. 



DV Duong Vinh Binh August 15, 2019 12:43 PM UTC

Dear  Vinoth Srinivasan (Syncfusion).

I have 2 errors need to the your support :
1. Load reports connected by the Web API fails, an error "Unhandled exception has occurred during data set 'DataSet1' processing." (but when loading with Syncfusion's Report server, OK.).
2. Report Designer using Web API does not have a datasource "WebAPI" like Syncfusion's Report server.
Send you 2 files to check.

figure 1:
Load report with Web API


figure 2:
Report Designer using Web API 

 Syncfusion's Report server


I hope to receive the your support.
Best regards.

Attachment: code_and_report_90ed84c4.ZIP


VS Vinoth Srinivasan Syncfusion Team August 19, 2019 06:17 AM UTC

Hi Duong Vinh Binh, 

Thanks for the update. 

Can you provide more details of your requirement how you are going to use our reporting tools with your development? If you are trying to make use of our component along with Report Server then we can able to provide the solution along with Report Server. 

Regards, 
Vinoth S. 



DV Duong Vinh Binh August 19, 2019 09:14 AM UTC

Dear  Vinoth Srinivasan (Syncfusion).

I have 2 errors need to the your support :

1.

I have created 2 Web APIs according to your instructions, including: Report Viewer and Repor Designer. Both published APIs go to localhost, port 88.

http://localhost:88/report/api/Viewer

http://localhost:88/report/api/Designer

After that, I created a simple report, only 1 textbox and ran the application OK (report displayed).

Continue, I created a more complex new report (Use Syncfusion's Report server.), including 1 Grid with datasources as a Web API (http: // localhost: 88 / CMIS3 / Api / Test / SelectByID / PB0401) to get the data to fill in the columns of the Grid then the Error Report "Unhandled exceptio