2.0 KiB
title | description | type | page_title | slug | position | tags | ticketid | res_type |
---|---|---|---|---|---|---|---|---|
Remove Opened Reports with Code in the Web Report Designer | How to remove reports already opened in the Web Report Designer with code | how-to | How to remove opened reports from the web designer | remove-opened-reports-web-designer | 1540231, 1540534 | kb |
Environment
Product | Progress® Telerik® Reporting |
Description
The [Web Report Designer]({%slug telerikreporting/designing-reports/report-designer-tools/web-report-designer/overview%}) utilizes the browser local storage to keep the previously opened reports. For that reason, if you close the designer without closing the reports, on the next designer opening in the same browser, all the previously opened reports will be re-opened. In some scenarios, this may cause failures.
Suggested Workarounds
-
We have introduced the web designer property 'Preserve open reports on exit'. You may find it under Preferences > GENERAL when you open the Workspace preferences Menu option. The user may uncheck it to disable displaying the opened reports on a refresh of the browser. If you need to do this with code, you may use the following function in the initialization of the designer, and the keeping of the opened reports on refresh will be disabled:
window.localStorage.setItem("RestoreReports", "false");
-
You may use JavaScript to remove the previously opened reports and the last one that is kept separately:
window.localStorage.removeItem("PreviouslyOpenedReports"); window.localStorage.removeItem("LastOpenedReport")
Notes
In Blazor you may invoke JavaScript functions as explained in the Microsoft article Call JavaScript functions from .NET methods in ASP.NET Core Blazor.