Hi,
We are displaying report using HTML5 report viewer in our angularjs application (calling $("#container").telerik_ReportViewer(options)). When the user navigates to another report or another page the report generation and api calls(to get instances and documents) should be cancelled. Is there any way to do it?
Regards,
Majar
3 Answers, 1 is accepted
Currently, the generation of a report cannot be cancelled.
A possible workaround is to run the ReportProcessor in a separate thread, and kill the thread based on some custom condition (for example on certain period of time).
Regards,
Silviya
Progress Telerik
Hi Silviya,
But if I try generating a new report while another being generated, the report (one which is being generated) is getting cancelled. How is it happening?
Also, as per my understanding all pages of a report is being generated and stored in back end. Even if a user wants to see few pages, all the pages are being generated. This is causing lot memory and CPU usage. Is there any way to change it so that only the requested page will be generated instead of all pages?
Regards,
Majar
What do you mean by "if I try generating a new report while another being generated"? Are you using navigate to Report action in the initial report?
Up to the concerns, reports are processed and rendered on the server at once. Which includes retrieving the whole data and rendering the report template with it. Thus the machine should have enough resources (memory, CPU) to handle the reports generation. The produced on the server HTML and resources are delivered to the client through the Reporting REST service for the HTML5 Viewer.
Unless, there is an error in the report the processing cannot be cancelled. If there is an error during the report processing, it can be caught in the report's Error event and canceled through the event's arguments.
If I understood correctly, the reports you generate have a lot of pages. Such reports are not suitable for displaying in a browser Report Viewer, since they require lots of resource, and it would not be very convenient for the user to go through such large reports.
My suggestion would be to generate the report programmatically in one of our export format, for example PDF. Note that there is significant performance improvements for Excel rendering and PDF rendering extensions, as well as memory usage optimization for the PDF rendering extension following the last official release of Telerik Reporting - R3 2017 (version 11.2.17.913).
Other suggestion is to use one of our desktop viewers (for example, WinForms ReportViewer) which has a stop button.
More suggestions for optimizing the report's performance can be found in Performance Considerations help article.
Regards,
Silviya
Progress Telerik