A long export can be started asynchronously and its progress polled through the Server REST API task status.

Start the export, then read the task status.
// Run the template producing a task key
var export = WebRequest.Create($"{RestUrl}/reporttemplates/{ReportTemplateKey}/run");
export.Method = "PUT";
export.Headers.Add("x-sti-SessionKey", sessionKey);
export.Headers.Add("x-sti-DestinationItemKey", pdfFileItemKey);
var taskKey = GetResponseJson(export).Value<string>("ResultTaskKey");

// Poll the task status
var statusReq = WebRequest.Create($"{RestUrl}/task/{taskKey}");
statusReq.Headers.Add("x-sti-SessionKey", sessionKey);
var status = GetResponseJson(statusReq).Value<JObject>("ResultStatus");
// status["IsRunning"], status["IsFinished"], status["IsError"] ..."));

How it works. The export is a background task keyed by id, so a client can start it and check on its progress without holding the connection open.

By using this website, you agree to the use of cookies for analytics and personalized content. Cookies store useful information on your computer to help us improve efficiency and usability. For more information, please read the privacy policy and cookie policy.