How to set report name in web report designer through url of the browser?

1 Answer 393 Views
Report Designer - Web
Tursunkhuja
Top achievements
Rank 2
Iron
Iron
Veteran
Tursunkhuja asked on 01 Dec 2021, 09:30 AM

Hi,

In our project we are using html5 report viewer and web report designer. There is an issue with the report web designer.

To reproduce it you can use Html5IntegrationDemo project from "..Progress\Telerik Reporting R3 2021\Examples\CSharp\.NET 5\Html5IntegrationDemo" folder.

For the report name we want to get dynamically from URL. To do this we changed webReportDesigner.html file with this custom code:

If you open "Dashboard" report it will work fine: http://localhost:51862/webReportDesigner.html?report=Dashboard.trdp

But, on second time, if you try to open another report it still opening previous report. http://localhost:51862/webReportDesigner.html?report=Barcodes%20Report.trdp

It's opening "Dashboard" report instead of opening "Barcodes" report. 

How we should design to be able to open only correct report?

 

Thank you,

Dimitar
Telerik team
commented on 03 Dec 2021, 12:57 PM

The problem is that the options of the Web Report Designer are respected only once- when the page is loaded. This means that if you want to change a property after the report designer was loaded, you need to reload the whole page with the new setting. This is required because we don't provide a method for setting the report property, similar to what you can do with the HTML5-based report viewers. For example How to Pass Values to Report Parameters.

We have such a feature request that is already logged on our feedback portal--Set report of Web Report Designer dynamically and I voted for it on your behalf. When there is an update, you will receive a notification.

Tursunkhuja
Top achievements
Rank 2
Iron
Iron
Veteran
commented on 06 Dec 2021, 05:41 AM

Hi Dimitar,

I'm not setting report property dynamically without loading the page. I set report name via page url and I always reload the page after set new report name. Does it get new values on reloading the page (or clicking F5) ?

Dimitar
Telerik team
commented on 08 Dec 2021, 02:35 PM

It should be getting the report value on a page reload(not sure if clearing cache is required).

I have attached an example project on how to make the designer load a report dynamically, please check it out.

1 Answer, 1 is accepted

Sort by
1
Byron
Top achievements
Rank 1
Iron
answered on 31 Dec 2021, 11:54 AM

There's a key in local storage LastOpenedReport. If this key exist, the designer will load report from it.

You need to delete this key before init the report designer. Hope it helps.

localStorage.removeItem("LastOpenedReport");

 

Shawn
Top achievements
Rank 2
commented on 10 May 2023, 04:39 AM

Thanks Byron this worked.

@Telerik support, I believe this is a bug though.  If the reportName is being set via a querystring parameter of the url, then it means the page IS being reloaded, and thus the new reportName should be honored.

I've applied Byron's workaround, but I expect this will have some interesting consequences when a user has multiple report designer instances opened in multiple tabs.  If there is any report designer logic that is dependent on this "LastOpenedReport" value in local storage, that logic will be affected by the sequence in which the user opens report designer tabs and saves changes to different report designs!

Dimitar
Telerik team
commented on 12 May 2023, 12:17 PM

Hello Shawn,

Thank you for the feedback!

We have recently been discussing how to improve the Web Report Designer on this part. Currently, we are leaning towards having the value specified during the initialization of the Web Report Designer respected by default, unless told not to, and displaying a list of the last opened reports on the page. All I mean to say by this is that we are looking into improving this behavior and will welcome any suggestions!

Tags
Report Designer - Web
Asked by
Tursunkhuja
Top achievements
Rank 2
Iron
Iron
Veteran
Answers by
Byron
Top achievements
Rank 1
Iron
Share this question
or