Page 1 of 1

report preview fails after 2 minutes

Posted: Wed Jun 12, 2019 7:34 pm
by someGuyFromSomewhere
Preview functionality works without issue for the vast majority of our reports, however, it doesn't work for reports that take a significant amount of time to be generated. Our testing indicated that after two minutes (120 seconds), the preview would just stop running and it would return to the 'Home' tab.

After a thorough examination, it was discovered that this behavior was due to some code that caused a "Synchronization" command to be issued after 120000 milliseconds (120 seconds). That value was hard-coded in the Stimulsoft.Report.WebDesign\Designer\Scripts\Base\Ajax.js file. As a test, we doubled the value to 240000 milliseconds (240 seconds, or four minutes) and the problematic reports previewed successfully.

So my question is, what is this "Synchronization" code for, and what are the risks of increasing the time at which the command is issued.

Here is the code in question ('Synchronization' part is near bottom):

Code: Select all

StiMobileDesigner.prototype.ExecuteCommandFromStack = function() {
    var params = this.options.commands[0];

    if (this.ShowMainLoadProcess(params.command)) {
        var processImage = this.options.processImage || this.InitializeProcessImage();
        processImage.show();
    }
    else {
        if (this.options.processImageStatusPanel) this.options.processImageStatusPanel.show();
    }

    this.PostAjax(this.options.requestUrl, params, this.receveFromServer);

    clearTimeout(this.options.timerAjax);

    var jsObject = this;
    this.options.timerAjax = setTimeout(function() {
        jsObject.Synchronization();
    }, params.command != "Synchronization" ? 120000 : 15000);
}

Re: report preview fails after 2 minutes

Posted: Thu Jun 13, 2019 12:55 pm
by Lech Kulikowski
Hello,

Synchronization - reconnect to the server if connect is lost. You can set the necessary value for requestTimeout option:
params.command != "Synchronization" ? Math.max(this.options.requestTimeout, 120000) : 15000);

Thank you.