How to know when the report preview is rendered completely?

Stimulsoft Reports.JS discussion
titanotam
Posts: 12
Joined: Thu Jun 29, 2017 6:22 am

Re: How to know when the report preview is rendered complete

Post by titanotam »

HighAley wrote:Hello.

Unfortunately, there is no such event and the StiEndRenderEvent will not help you.
Maybe it will be better to export the report to HTML and then you can do with this HTML all that you need.

Thank you.
Ok, I'll try this

Thanks
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: How to know when the report preview is rendered complete

Post by HighAley »

Hello.

You could find a sample here:
https://github.com/stimulsoft/Samples-J ... 0HTML.html
Let us know if you need additional help.

Thank you.
titanotam
Posts: 12
Joined: Thu Jun 29, 2017 6:22 am

Re: How to know when the report preview is rendered complete

Post by titanotam »

Hi,

I solve my problem by using the jQuery event and looking for DOM change on the div that contains the rendered report. Since the DOM is changed continuously, I need to wait to make sure there is no DOM change event is fired anymore, then I continue to capture the report thumbnail

Code: Select all

var previewRenderTimer;
var previewRenderInterval = 1000;<-- time to wait to make sure there is no DOM change event anymore
...
$('div#StiDesigner_Viewer_JsViewerMainPanel').on("DOMSubtreeModified", () => {
            clearTimeout(previewRenderTimer);
            previewRenderTimer = setTimeout(createReportThumbnailFunc, previewRenderInterval);
});
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: How to know when the report preview is rendered complete

Post by Alex K. »

Hello,

Thank you for the information about your solution.

Thank you.
Post Reply