Java Interrupt Rendering

Stimulsoft Reports.JAVA discussion
Post Reply
Richard
Posts: 4
Joined: Mon Feb 27, 2017 2:23 pm

Java Interrupt Rendering

Post by Richard »

Hello,

Is it possible to start rendering a report from code, with the possibility to interrupt it during the rendering? If so, how? I found the attribute isStopped, that should stop the rendering after a page finishes, but I can't find a way to set it during the rendering process.

Kind regards,
Richard.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Java Interrupt Rendering

Post by Alex K. »

Hello,

In this case, you can set the StopBeforePage property of the report.

Thank you.
Richard
Posts: 4
Joined: Mon Feb 27, 2017 2:23 pm

Re: Java Interrupt Rendering

Post by Richard »

I tried it - I would stop rendering after each page, and if no interruption occured, I would just increase the StopBeforePage property by one, and call Render again.

This solved my problem, thank you!

Have a great day!

Edit: It didn't work as I previously thought. Follow up in next post.
Last edited by Richard on Wed May 10, 2017 1:56 pm, edited 1 time in total.
Richard
Posts: 4
Joined: Mon Feb 27, 2017 2:23 pm

Re: Java Interrupt Rendering

Post by Richard »

Sorry, I was mistaken, it did not work as I expected.

My problem is this:
I wanted to render the report page by page, so if it takes too long, a user can stop the rendering. I would run it in it's own thread, but I can't just render it at once, because it could take several minutes to finish rendering entirely, and the thread would be busy the whole time.

So I tried your suggestion, rendered a single page, then checked the current state, rendered another page, and so on...

But if I stop the rendering at some point, I can't continue from where I paused. If I have already rendered pages 1 to 9, and I render JUST the page number 10, the last page takes the same time to render as if I would render pages 1 to 10.
Does the rendering start all over if I call Render()? Does it ignore the already rendered pages?

So I am rephrasing my question:
Is it possible to pause the rendering process (for example at some page), and then continue with the rendering? Without having to render it all again?

Because now, if I continue by calling render again, it renders the whole thing again from scratch.

Thank you for your time.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Java Interrupt Rendering

Post by Alex K. »

Hello,

Unfortunately, this feature is not available in our products.
As a way, you can split the report into several parts, render it and then merge it in one report.

Thank you.
Richard
Posts: 4
Joined: Mon Feb 27, 2017 2:23 pm

Re: Java Interrupt Rendering

Post by Richard »

Thank you for your time.

Best regards,
Richard.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Java Interrupt Rendering

Post by Alex K. »

Hello

We are always glad to help you!
Please let us know if you need any additional help.

Thank you.
Post Reply