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 » Tue Oct 17, 2017 10:14 am

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: 7821
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 » Wed Oct 18, 2017 4:45 pm

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 » Wed Nov 01, 2017 1:43 pm

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: 6476
Joined: Thu Jul 29, 2010 2:37 am

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

Post by Alex K. » Thu Nov 02, 2017 12:04 pm

Hello,

Thank you for the information about your solution.

Thank you.
Post Reply