Report Viewer parameters get detached on second opening

I have a report that works fine on first opening, but on any subsequent opening it reverts to the default parameters for its data.

I have two windows. Window A has a button that opens Window B, passing in three parameters. Window B contains a Report Viewer pointed at my report. The three parameters of the report are attached to Window B’s parameters using the Property Binding.

The very first time Window B opens, the report uses the parameters as designed. Works great. Window B has a “Close” button to close that window. I’ve even used the script: system.nav.closeParentWindow(event) and the result is the same.

When I then use Window A to open Window B again (with new or same parameters passed in), the Report Viewer does not get the Window B parameters passed in. I have debugged it out and saw that the Window B parameter are correct, but the Report Viewer parameters are set to “None”.

I don’t have any other odd or special scripting. The Report uses a Tag History query with a couple of time series charts. Nothing out of the ordinary.

I’m thinking I need to manually set the Report Viewer properties and then refresh it upon Window B open, but that kinda defeats the purpose of binding its parameters.

Thoughts?

This is a known issue and we’re working on a fix. :blush:

The problem is a timing issue between when the report starts getting loaded in the window and when the parameters fire a property change event.

Gotcha. Thanks for the update!
Any tips on a workaround before I dive in and figure one out?

My notes on the ticket said that I had luck using a script to change the value of the custom property and then changing the value back. This would have to be done after the report loads, and there’s no way to get that event with a script, so it would either have to be a button on the screen or use a delay that will hopefully be long enough. Wish I had a more elegant idea for you…

Thanks. That helps.
I’m guessing the first time the page loads, it takes slightly longer, so the Report Viewer has a little more time.

I’ve tried to use Client tags attached to my Report Viewer parameters, instead of passing in parameters through the window and that did not work. Curiously, when I would bind the Report Viewer parameters to Client Tags, it would work once and then also detach and not work again until I manually reset the binding. It would show it was bound, but had no value.

So my next route was to just skip all that and use Client tags as default values for my Report parameters (done directly in the report designer). That appears to be completely non-functional.

Can you use Client tags in the Report Parameters?

No, because reports are executed on the Gateway. They should work as overrides in the Vision component or client scripts.

In 7.8.1 we’ve removed the client tags from the tag selection tree when you are setting up report parameters in the reporting workspace, so that you won’t be tempted to use them.

And we’re on 7.8.0, so yeah, i was tempted to use them since they were available :slight_smile:
When will 7.8.1 be on the website to download?

Can you supply the code for the workaround? Not being able to pass parameters into the reports will make them kinda unusable. Thanks!

We’re doing the final QA on 7.8.1-rc1 right now. Current estimate is EOW.

But just to be clear, the fix won’t be in 7.8.1-rc1, since we haven’t figured out a good permanent fix yet.

I’ve also tried wrapping the Report Viewer in a template, thinking that may help, and possibly using the template repeater to create a “fresh” instance of the control when the page opens, but there’s no love on that approach (yet).

It seems like the Report Viewer will not stay bound to parameters unless it’s tied directly to a control object on the same screen (like a date picker). That works for a few simple reports here and there, but I’ve got bigger plans than that. :smiley:

Okay, so wrapping the Report Viewer in a Template and using the Template Canvas DID work. I can now launch the report repeatedly and it renders correctly each time.

You have to catch the event for “componentRunning” on the Canvas and then setup the dataset to feed it, which includes your wrapped Report Viewer Template and the parameters you need to pass in.

Not the most elegant solution, but a solution nonetheless!

Glad to hear it!

I think I’ve found the solution and it should be in 7.8.2, so you won’t have to be inelegant for too long.

Hi! I still have this problem…report viewer “losts” its parameter…
Thank you for some idea

This shouldn’t be happening the the latest version. Could you please email in to support so they can figure out what’s going wrong for you?