Limiting report generation time

Posted by: john.davys on 5 November 2023, 10:22 am EST

    • Post Options:
    • Link

    Posted 5 November 2023, 10:22 am EST

    What is the best way to stop reporting users taking up too much database resource e.g. reports that have inefficient queries that take too long to process or bring back too many rows etc? Is there a way to set the database query timeout setting (SQL Server) on a per-report basis, or can we use the cancel argument of the page report render method to stop it after a specified time etc?

  • Posted 5 November 2023, 6:54 pm EST

    Hi John,

    You can cancel the report rendering if the report takes too long to complete. By checking if documentLoaded method is called within the set duration after a report is opened into the viewer.

    Please refer to the attached sample.

    ReportLoadCancel.zip

  • Posted 12 November 2023, 3:44 pm EST

    Hi Akshay

    Thanks for your response to my question. To give you a bit more detail, we are using ActiveReports.Net v17.2 and we are building an application that includes providing the ActiveReports designer to the users, embedded in an Angular web site. We need a way to limit the Preview report feature from taking too much time to display or placing too much load on the database; plus when we render a report to the requested output format, we would like to control how much resource that takes too. The Render() method has an overload that takes a cancellation token so I think we are fine there, but how would we limit the Preview window display time?

    Regards

    John

  • Posted 14 November 2023, 3:12 pm EST

    Hi John,

    It seems that your use case is very similar to the one discussed over the following forum post: https://developer.mescius.com/forums/activereports/prevent-user-from-pressing-preview-multiple-times

    So I would suggest you to go through the following forum post first and let us know know if you still have any issues.

    As for limiting the preview window display time, to reduce the time it takes to render a report I would suggest you to create another server in between which caches the request in regular time interval and it will reduce the time it takes to complete each request. This will also reduce the load from your servers.

  • Posted 15 November 2023, 12:44 pm EST

    Thanks Akshay, I’ll investigate that approach and see if it works for us.

    Regards

    John

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels