Telerik Reporting REST Services Overview
The Telerik Reporting REST service exposes the report generation engine through an HTTP application programming interface (API). The engine renders report documents in all supported formats.
The service uses simple Data Transfer Objects (DTOs) for client-server communication. All DTOs use JSON encoding.
The primary use of the service is with the HTML5 Report Viewer, which has a client-side implementation.
You can use the Reporting REST service in a JavaScript application without the viewer. Refer to the
telerikReportViewer.ServiceClientclass in the JavaScript API.
This chapter describes implementations for several web service frameworks.
How It Works
The Reporting REST service exposes all report generation assets as web resources that can be accessed from specific web endpoints. These exposed assets include:
- Report instances
- Report documents
- Images
- Other rendered report metadata
To access these report generation assets, a client host issues a set of requests and wraps them in a client session identified by clientId.
Serving a Request
The following steps describe how the Reporting REST service serves a client's request:
- The client requests a report by sending a JSON object called a client report source.
- The service resolves the request to a .NET report source. To do that, it uses a REST Service Report Source Resolver.
- The service serves the rendered reports as web-accessible resources.
- The service caches all generated resources in a REST Service Storage of choice.
Configuration Hints
You can configure the report service in the application's .config or .json configuration file, depending on the service implementation. For more details, see the restReportService element.
You can also configure the following service behaviors:
-
The client session expires after a configurable period. Within a single client session, the same request returns the same cached resource.
To regenerate a report for the Refresh Report functionality, set
"useCache": falsein the JSON request body sent to the Resolve Document endpoint. -
If a browser-based client is hosted on a different origin from the service, enable Cross-Origin Resource Sharing (CORS) for the client's origin.
-
The service executes report generation requests in a task queue. Configure the number of reports rendered at the same time in the REST service configuration.
-
To host two or more report services in one application, assign a unique
HostAppIdproperty to each controller. This creates a dedicated task queue for each service instance. Set the worker count for each queue to avoid system overload.