Cannot Access the Reporting REST Service
Environment
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 or cannot be accessed by the viewer.
Solution
There are two main reasons for this error. 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.
-
The REST Service is missing or not configured correctly:
If the response to the above request is not as expected:
-
Check whether the
ReportsController
is configured correctly- In ASP.NET as explained in the articles under ASP.NET Web API Implementation
- In ASP.NET Core as explained in the articles under ASP.NET Core Web API Implementation.
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.
-
CORS is not configured correctly: If the REST Service is returning the available export formats, the report viewer client may not be able to access the service due to CORS limitations. When such an issue is present you will see a CORS-related error message in the browser's developer tools console (press
F12
to open it). 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
The recommended troubleshooting approach is to use Fiddler or another proxy tool to check the requests, responses, and their statuses.
This will let you check requests to the Reporting REST service and whether 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, record a SAZ file with Fiddler while running the application and share the log as a link with us in a support ticket.
To help troubleshoot the issue, you may also record a trace listener log:
- For ASP.NET Core application, see the Troubleshooting reporting implementation into ASP.NET Core application article.
- For .NET Framework application, see the Create and Initialize Trace Listeners Microsoft article.