A Server report can be run and shared from browser JavaScript by working with a report snapshot through REST.

Log in, run into a snapshot, share it.
function RunReport() {
    var sessionKey = Connect();   // GET /1/login with x-sti-UserName/Password headers

    // Create a snapshot
    var snap = new XMLHttpRequest();
    snap.open('POST', 'http://localhost:40010/1/reportsnapshots', false);
    snap.setRequestHeader('x-sti-SessionKey', sessionKey);
    snap.send(JSON.stringify({ Ident: 'ReportSnapshotItem', Name: '001', Expires: expires }));
    var snapshotKey = JSON.parse(snap.responseText).ResultItems[0].Key;

    // Run the template into the snapshot
    var run = new XMLHttpRequest();
    run.open('PUT', 'http://localhost:40010/1/reporttemplates/' + reportKey + '/run', false);
    run.setRequestHeader('x-sti-SessionKey', sessionKey);
    run.setRequestHeader('x-sti-DestinationItemKey', snapshotKey);
    run.send();

    // Share the snapshot and open its public URL
    // PUT /1/items/{snapshotKey}/share  ->  GET .../share  ->  location.href = ResultUrl
}

How it works. Plain XMLHttpRequest calls chain the Server's REST endpoints, so a browser page can run and publish a report with no backend of its own.

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.