Cannot access the Reporting REST service. (serviceUrl = '/api/reports'). Make sure the service address is correct and enable CORS if needed. (https://enable-cors.org)

Environment

Product Version 12.2.18.1017
Product Progress® Telerik® Reporting
Viewer HTML5 Viewer

Error Message

Cannot access the Reporting REST service. (serviceUrl = '/api/reports'). Make sure the service address is correct and enable CORS if needed. (https://enable-cors.org)

Cause\Possible Cause(s)

The error indicates that the Telerik Reporting REST Service is not working properly.

Solution

There are two possible reasons for this error:

  1. The REST Service is missing or not configured correctly: In order to identify that, check the response to /api/reports/formats GET request that should return the available document formats (see Get Available Document Formats article). If the response to the above request is not as expected, then check How To: Add Telerik Reporting REST Web API to Web Application article. Check the viewer's serviceUrl and adjust the relative path. Test adding "~" or remove the first "/" - ASP.NET Web Project Paths. The issue might be related to WebAPI controllers duplicating routes, which can be avoided by changing the registered by default Telerik Reporting REST Web API routes.

  2. CORS is not configured correctly: If however, the Rest Service is returning the available export formats, I assume that the report viewer client cannot access the service due to CORS limitations. When such issue is present you will see a CORS related error message in the browser's developer tools console (F12). When hosting the service in a separate application you will need to enable CORS as explained in Enable cross-origin requests in ASP.NET Web API 2 article.

Notes

Тhe recommended troubleshooting approach is to use Fiddler or other proxy tool to check the requests, their responses and statuses. Information about requests and responses content can be seen in Fiddler -> Inspectors -> Request/Response -> Raw tabs. This will let you check requests to the Reporting REST service and if the URLs are correct (if relative paths are resolved correctly). Relative paths may need adjustment depending on how the application is hosted.

If the problem persists, create a SAZ file recorded by Fiddler while running the application. After you generate the log file, archive it and attach it to a support ticket.

In this article
Not finding the help you need? Improve this article