New to Telerik Report Server? Request free 30-day trial


To export a report, you need the ID of the report and know the document format in which it would be exported. The actual report export is achieved with two requests. The first request creates a document with the specified parameters and when the document is ready you can get it via a second, GET request.

In order to perform report server operations, you have to login first and get an access token.

Here is a sample function to illustrate the approach:

  var serverHost = "http://reportserver:83/";
  var serverApi = serverHost + "api/reportserver/v2/";

  function exportDocument(reportId, format, parameterValues, asAttachment) {
    if (!reportId) {
      window.alert('Please, select a report.');

    var data = {
      ReportId: reportId,
      Format: format,
      ParameterValues: parameterValues,

    var token =

    var headers = {};

    if (token) {
      headers.Authorization = 'Bearer ' + token;

      type: "POST",
      url: serverApi + "documents",
      contentType: 'application/json',
      data: JSON.stringify(data),
      headers: headers
    .done(function (data) {
      var documentId = data;

      var queryString = "";

      if (asAttachment) {
        queryString += "content-disposition=attachment";

      var exportUrl =
          serverApi + "documents/" + documentId + "?" + queryString;;


The described function can be used in the following way:

<input type="button" value="Download in XLSX format" onclick="exportDocument('160945-e651', 'XLSX', { 'OrderNumber' : 'SO51115' }, true);" />

With the content-disposition query parameter you can control whether to download the document as a file or open it directly into the browser window.

In this article